home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / contrib / dvx / inc / x11 / xlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  99.6 KB  |  3,927 lines

  1. /* $XConsortium: Xlib.h,v 11.179 89/12/12 13:57:19 jim Exp $ */
  2. /* 
  3.  * Copyright 1985, 1986, 1987 by the Massachusetts Institute of Technology
  4.  *
  5.  * Permission to use, copy, modify, and distribute this software and its
  6.  * documentation for any purpose and without fee is hereby granted, provided 
  7.  * that the above copyright notice appear in all copies and that both that 
  8.  * copyright notice and this permission notice appear in supporting 
  9.  * documentation, and that the name of M.I.T. not be used in advertising
  10.  * or publicity pertaining to distribution of the software without specific, 
  11.  * written prior permission. M.I.T. makes no representations about the 
  12.  * suitability of this software for any purpose.  It is provided "as is"
  13.  * without express or implied warranty.
  14.  *
  15.  * The X Window System is a Trademark of MIT.
  16.  *
  17.  */
  18.  
  19.  
  20. /*
  21.  *    Xlib.h - Header definition and support file for the C subroutine
  22.  *    interface library (Xlib) to the X Window System Protocol (V11).
  23.  *    Structures and symbols starting with "_" are private to the library.
  24.  */
  25. #ifndef _XLIB_H_
  26. #define _XLIB_H_
  27.  
  28. #ifdef USG
  29. #ifndef __TYPES__
  30. #include <sys/types.h>            /* forgot to protect it... */
  31. #define __TYPES__
  32. #endif /* __TYPES__ */
  33. #else
  34. #include <sys/types.h>
  35. #endif /* USG */
  36.  
  37. #ifndef _CADDR_T_DEF_
  38. #ifndef __NDPC__
  39. typedef char *      caddr_t;
  40. #endif
  41. #define _CADDR_T_DEF_ /* MJCR/POHC 91/03/01 */
  42. #endif
  43.  
  44. #include <X11/X.h>
  45.  
  46. #ifndef NeedFunctionPrototypes
  47. #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
  48. #define NeedFunctionPrototypes 1
  49. #else
  50. #define NeedFunctionPrototypes 0
  51. #endif /* __STDC__ */
  52. #endif /* NeedFunctionPrototypes */
  53.  
  54. #ifndef NeedWidePrototypes
  55. #if defined(NARROWPROTO)
  56. #define NeedWidePrototypes 0
  57. #else
  58. #define NeedWidePrototypes 1        /* default to make interropt. easier */
  59. #endif
  60. #endif
  61.  
  62. #ifdef __cplusplus            /* do not leave open across includes */
  63. extern "C" {                    /* for C++ V2.0 */
  64. #endif
  65.  
  66. #if defined(MSDOS) && !defined(__GNUC__) && !defined(__SALFORD__)
  67. /* Special case for MSDOS/PCDOS. 90/06/18 POHC */
  68. #define bcopy(a,b,c)    memcpy(b,a,c)
  69. #define bcmp(a,b,c)     memcmp(a,b,c)
  70. #define bzero(a,b)      memset(a,0,b)
  71.  
  72. #ifndef index
  73. #define index        strchr
  74. #endif
  75.  
  76. #ifndef rindex
  77. #define rindex        strrchr
  78. #endif
  79.  
  80. #endif
  81.  
  82. #define Bool int
  83. #define Status int
  84. #define True 1
  85. #define False 0
  86.  
  87. #define QueuedAlready 0
  88. #define QueuedAfterReading 1
  89. #define QueuedAfterFlush 2
  90.  
  91. #define ConnectionNumber(dpy)     ((dpy)->fd)
  92. #define RootWindow(dpy, scr)     (((dpy)->screens[(scr)]).root)
  93. #define DefaultScreen(dpy)     ((dpy)->default_screen)
  94. #define DefaultRootWindow(dpy)     (((dpy)->screens[(dpy)->default_screen]).root)
  95. #define DefaultVisual(dpy, scr) (((dpy)->screens[(scr)]).root_visual)
  96. #define DefaultGC(dpy, scr)     (((dpy)->screens[(scr)]).default_gc)
  97. #define BlackPixel(dpy, scr)     (((dpy)->screens[(scr)]).black_pixel)
  98. #define WhitePixel(dpy, scr)     (((dpy)->screens[(scr)]).white_pixel)
  99. #define AllPlanes         (~0L) /* POHC 90/10/09 */
  100. #define QLength(dpy)         ((dpy)->qlen)
  101. #define DisplayWidth(dpy, scr)     (((dpy)->screens[(scr)]).width)
  102. #define DisplayHeight(dpy, scr) (((dpy)->screens[(scr)]).height)
  103. #define DisplayWidthMM(dpy, scr)(((dpy)->screens[(scr)]).mwidth)
  104. #define DisplayHeightMM(dpy, scr)(((dpy)->screens[(scr)]).mheight)
  105. #define DisplayPlanes(dpy, scr) (((dpy)->screens[(scr)]).root_depth)
  106. #define DisplayCells(dpy, scr)     (DefaultVisual((dpy), (scr))->map_entries)
  107. #define ScreenCount(dpy)     ((dpy)->nscreens)
  108. #define ServerVendor(dpy)     ((dpy)->vendor)
  109. #define ProtocolVersion(dpy)     ((dpy)->proto_major_version)
  110. #define ProtocolRevision(dpy)     ((dpy)->proto_minor_version)
  111. #define VendorRelease(dpy)     ((dpy)->release)
  112. #define DisplayString(dpy)     ((dpy)->display_name)
  113. #define DefaultDepth(dpy, scr)     (((dpy)->screens[(scr)]).root_depth)
  114. #define DefaultColormap(dpy, scr)(((dpy)->screens[(scr)]).cmap)
  115. #define BitmapUnit(dpy)     ((dpy)->bitmap_unit)
  116. #define BitmapBitOrder(dpy)     ((dpy)->bitmap_bit_order)
  117. #define BitmapPad(dpy)         ((dpy)->bitmap_pad)
  118. #define ImageByteOrder(dpy)     ((dpy)->byte_order)
  119. #define NextRequest(dpy)    ((dpy)->request + 1)
  120. #define LastKnownRequestProcessed(dpy)    ((dpy)->last_request_read)
  121.  
  122. /* macros for screen oriented applications (toolkit) */
  123. #define ScreenOfDisplay(dpy, scr)(&((dpy)->screens[(scr)]))
  124. #define DefaultScreenOfDisplay(dpy) (&((dpy)->screens[(dpy)->default_screen]))
  125. #define DisplayOfScreen(s)    ((s)->display)
  126. #define RootWindowOfScreen(s)    ((s)->root)
  127. #define BlackPixelOfScreen(s)    ((s)->black_pixel)
  128. #define WhitePixelOfScreen(s)    ((s)->white_pixel)
  129. #define DefaultColormapOfScreen(s)((s)->cmap)
  130. #define DefaultDepthOfScreen(s)    ((s)->root_depth)
  131. #define DefaultGCOfScreen(s)    ((s)->default_gc)
  132. #define DefaultVisualOfScreen(s)((s)->root_visual)
  133. #define WidthOfScreen(s)    ((s)->width)
  134. #define HeightOfScreen(s)    ((s)->height)
  135. #define WidthMMOfScreen(s)    ((s)->mwidth)
  136. #define HeightMMOfScreen(s)    ((s)->mheight)
  137. #define PlanesOfScreen(s)    ((s)->root_depth)
  138. #define CellsOfScreen(s)    (DefaultVisualOfScreen((s))->map_entries)
  139. #define MinCmapsOfScreen(s)    ((s)->min_maps)
  140. #define MaxCmapsOfScreen(s)    ((s)->max_maps)
  141. #define DoesSaveUnders(s)    ((s)->save_unders)
  142. #define DoesBackingStore(s)    ((s)->backing_store)
  143. #define EventMaskOfScreen(s)    ((s)->root_input_mask)
  144.  
  145. /*
  146.  * Extensions need a way to hang private data on some structures.
  147.  */
  148. typedef struct _XExtData {
  149.     int number;        /* number returned by XRegisterExtension */
  150.     struct _XExtData *next;    /* next item on list of data for structure */
  151.     int (*free_private)(
  152. #if NeedFunctionPtrPrototypes /* POHC 91/04/16 */
  153. struct _XExtData *
  154. #endif
  155. );    /* called to free private storage */
  156.     char *private_data;    /* data private to this extension. */
  157. } XExtData;
  158.  
  159. /*
  160.  * This file contains structures used by the extension mechanism.
  161.  */
  162. typedef struct _XExtCodes { /* Tagged. POHC 90/10/08 */        /* public to extension, cannot be changed */
  163.     int extension;        /* extension number */
  164.     int major_opcode;    /* major op-code assigned by server */
  165.     int first_event;    /* first event number for the extension */
  166.     int first_error;    /* first error number for the extension */
  167. } XExtCodes;
  168.  
  169. /*
  170.  * This structure is private to the library.
  171.  */
  172. typedef struct _XExten {    /* private to extension mechanism */
  173.     struct _XExten *next;    /* next in list */
  174.     XExtCodes codes;    /* public information, all extension told */
  175. #if NeedFunctionPtrPrototypes /* POHC 91/04/16 */
  176.     int (*create_GC)(struct _XDisplay *, struct _XGC *, XExtCodes *);    /* routine to call when GC created */
  177.     int (*copy_GC)(struct _XDisplay *, struct _XGC *, XExtCodes *);    /* routine to call when GC copied */
  178.     int (*flush_GC)(struct _XDisplay *, struct _XGC *, XExtCodes *);    /* routine to call when GC flushed */
  179.     int (*free_GC)(struct _XDisplay *, struct _XGC *, XExtCodes *);    /* routine to call when GC freed */
  180.     int (*create_Font)(struct _XDisplay *, struct _XFontStruct *, XExtCodes *);    /* routine to call when Font created */
  181.     int (*free_Font)(struct _XDisplay *, struct _XFontStruct *, XExtCodes *);    /* routine to call when Font freed */
  182.     int (*close_display)(struct _XDisplay *, XExtCodes *);    /* routine to call when connection closed */
  183.     int (*error)(struct _XDisplay *, struct _xError *, XExtCodes *, int *);        /* who to call when an error occurs */
  184.         char *(*error_string)(struct _XDisplay *, int, XExtCodes *, char *, int);  /* routine to supply error string */
  185. #else
  186.     int (*create_GC)();    /* routine to call when GC created */
  187.     int (*copy_GC)();    /* routine to call when GC copied */
  188.     int (*flush_GC)();    /* routine to call when GC flushed */
  189.     int (*free_GC)();    /* routine to call when GC freed */
  190.     int (*create_Font)();    /* routine to call when Font created */
  191.     int (*free_Font)();    /* routine to call when Font freed */
  192.     int (*close_display)();    /* routine to call when connection closed */
  193.     int (*error)();        /* who to call when an error occurs */
  194.         char *(*error_string)();  /* routine to supply error string */
  195. #endif
  196.     char *name;        /* name of this extension */
  197. } _XExtension;
  198.  
  199. /*
  200.  * Data structure for retrieving info about pixmap formats.
  201.  */
  202.  
  203. typedef struct _XPixmapFormatValues { /* Tagged. POHC 90/10/08 */
  204.     int depth;
  205.     int bits_per_pixel;
  206.     int scanline_pad;
  207. } XPixmapFormatValues;
  208.  
  209.  
  210. /*
  211.  * Data structure for setting graphics context.
  212.  */
  213. typedef struct _XGCValues { /* Tagged. POHC 90/10/08 */
  214.     int function;        /* logical operation */
  215.     unsigned long plane_mask;/* plane mask */
  216.     unsigned long foreground;/* foreground pixel */
  217.     unsigned long background;/* background pixel */
  218.     int line_width;        /* line width */
  219.     int line_style;         /* LineSolid, LineOnOffDash, LineDoubleDash */
  220.     int cap_style;          /* CapNotLast, CapButt, 
  221.                    CapRound, CapProjecting */
  222.     int join_style;         /* JoinMiter, JoinRound, JoinBevel */
  223.     int fill_style;         /* FillSolid, FillTiled, 
  224.                    FillStippled, FillOpaeueStippled */
  225.     int fill_rule;          /* EvenOddRule, WindingRule */
  226.     int arc_mode;        /* ArcChord, ArcPieSlice */
  227.     Pixmap tile;        /* tile pixmap for tiling operations */
  228.     Pixmap stipple;        /* stipple 1 plane pixmap for stipping */
  229.     int ts_x_origin;    /* offset for tile or stipple operations */
  230.     int ts_y_origin;
  231.         Font font;            /* default text font for text operations */
  232.     int subwindow_mode;     /* ClipByChildren, IncludeInferiors */
  233.     Bool graphics_exposures;/* boolean, should exposures be generated */
  234.     int clip_x_origin;    /* origin for clipping */
  235.     int clip_y_origin;
  236.     Pixmap clip_mask;    /* bitmap clipping; other calls for rects */
  237.     int dash_offset;    /* patterned/dashed line information */
  238.     char dashes;
  239. } XGCValues;
  240.  
  241. /*
  242.  * Graphics context.  All Xlib routines deal in this rather than
  243.  * in raw protocol GContext ID's.  This is so that the library can keep
  244.  * a "shadow" set of values, and thus avoid passing values over the
  245.  * wire which are not in fact changing. 
  246.  */
  247.  
  248. typedef struct _XGC {
  249.     XExtData *ext_data;    /* hook for extension to hang data */
  250.     GContext gid;    /* protocol ID for graphics context */
  251.     Bool rects;        /* boolean: TRUE if clipmask is list of rectangles */
  252.     Bool dashes;    /* boolean: TRUE if dash-list is really a list */
  253.     unsigned long dirty;/* cache dirty bits */
  254.     XGCValues values;    /* shadow structure of values */
  255. } *GC;
  256.  
  257.  
  258. /*
  259.  * Visual structure; contains information about colormapping possible.
  260.  */
  261. typedef struct _Visual { /* Tagged. POHC 90/10/08 */
  262.     XExtData *ext_data;    /* hook for extension to hang data */
  263.     VisualID visualid;    /* visual id of this visual */
  264. #if defined(__cplusplus) || defined(c_plusplus)
  265.     int c_class;        /* C++ class of screen (monochrome, etc.) */
  266. #else
  267.     int class;        /* class of screen (monochrome, etc.) */
  268. #endif
  269.     unsigned long red_mask, green_mask, blue_mask;    /* mask values */
  270.     int bits_per_rgb;    /* log base 2 of distinct color values */
  271.     int map_entries;    /* color map entries */
  272. } Visual;
  273.  
  274. /*
  275.  * Depth structure; contains information for each possible depth.
  276.  */    
  277. typedef struct _Depth { /* Tagged. POHC 90/10/08 */
  278.     int depth;        /* this depth (Z) of the depth */
  279.     int nvisuals;        /* number of Visual types at this depth */
  280.     Visual *visuals;    /* list of visuals possible at this depth */
  281. } Depth;
  282.  
  283. /*
  284.  * Information about the screen.
  285.  */
  286. typedef struct _Screen { /* Tagged. POHC 90/10/08 */
  287.     XExtData *ext_data;    /* hook for extension to hang data */
  288.     struct _XDisplay *display;/* back pointer to display structure */
  289.     Window root;        /* Root window id. */
  290.     int width, height;    /* width and height of screen */
  291.     int mwidth, mheight;    /* width and height of  in millimeters */
  292.     int ndepths;        /* number of depths possible */
  293.     Depth *depths;        /* list of allowable depths on the screen */
  294.     int root_depth;        /* bits per pixel */
  295.     Visual *root_visual;    /* root visual */
  296.     GC default_gc;        /* GC for the root root visual */
  297.     Colormap cmap;        /* default color map */
  298.     unsigned long white_pixel;
  299.     unsigned long black_pixel;    /* White and Black pixel values */
  300.     int max_maps, min_maps;    /* max and min color maps */
  301.     int backing_store;    /* Never, WhenMapped, Always */
  302.     Bool save_unders;    
  303.     long root_input_mask;    /* initial root input mask */
  304. } Screen;
  305.  
  306. /*
  307.  * Format structure; describes ZFormat data the screen will understand.
  308.  */
  309. typedef struct _ScreenFormat { /* Tagged. POHC 90/10/08 */
  310.     XExtData *ext_data;    /* hook for extension to hang data */
  311.     int depth;        /* depth of this image format */
  312.     int bits_per_pixel;    /* bits/pixel at this depth */
  313.     int scanline_pad;    /* scanline must padded to this multiple */
  314. } ScreenFormat;
  315.  
  316. #if (NeedFunctionPrototypes || NeedFunctionPtrPrototypes) /* POHC 91/04/16 */
  317.     /* prototypes require event type definitions */
  318. #undef _XSTRUCT_
  319. #endif
  320. #ifndef _XSTRUCT_    /* hack to reduce symbol load in Xlib routines */
  321. /*
  322.  * Data structure for setting window attributes.
  323.  */
  324. typedef struct _XSetWindowAttributes { /* Tagged. POHC 90/10/08 */
  325.     Pixmap background_pixmap;    /* background or None or ParentRelative */
  326.     unsigned long background_pixel;    /* background pixel */
  327.     Pixmap border_pixmap;    /* border of the window */
  328.     unsigned long border_pixel;    /* border pixel value */
  329.     int bit_gravity;        /* one of bit gravity values */
  330.     int win_gravity;        /* one of the window gravity values */
  331.     int backing_store;        /* NotUseful, WhenMapped, Always */
  332.     unsigned long backing_planes;/* planes to be preseved if possible */
  333.     unsigned long backing_pixel;/* value to use in restoring planes */
  334.     Bool save_under;        /* should bits under be saved? (popups) */
  335.     long event_mask;        /* set of events that should be saved */
  336.     long do_not_propagate_mask;    /* set of events that should not propagate */
  337.     Bool override_redirect;    /* boolean value for override-redirect */
  338.     Colormap colormap;        /* color map to be associated with window */
  339.     Cursor cursor;        /* cursor to be displayed (or None) */
  340. } XSetWindowAttributes;
  341.  
  342. typedef struct _XWindowAttributes { /* Tagged. POHC 90/10/08 */
  343.     int x, y;            /* location of window */
  344.     int width, height;        /* width and height of window */
  345.     int border_width;        /* border width of window */
  346.     int depth;              /* depth of window */
  347.     Visual *visual;        /* the associated visual structure */
  348.     Window root;            /* root of screen containing window */
  349. #if defined(__cplusplus) || defined(c_plusplus)
  350.     int c_class;        /* C++ InputOutput, InputOnly*/
  351. #else
  352.     int class;            /* InputOutput, InputOnly*/
  353. #endif
  354.     int bit_gravity;        /* one of bit gravity values */
  355.     int win_gravity;        /* one of the window gravity values */
  356.     int backing_store;        /* NotUseful, WhenMapped, Always */
  357.     unsigned long backing_planes;/* planes to be preserved if possible */
  358.     unsigned long backing_pixel;/* value to be used when restoring planes */
  359.     Bool save_under;        /* boolean, should bits under be saved? */
  360.     Colormap colormap;        /* color map to be associated with window */
  361.     Bool map_installed;        /* boolean, is color map currently installed*/
  362.     int map_state;        /* IsUnmapped, IsUnviewable, IsViewable */
  363.     long all_event_masks;    /* set of events all people have interest in*/
  364.     long your_event_mask;    /* my event mask */
  365.     long do_not_propagate_mask; /* set of events that should not propagate */
  366.     Bool override_redirect;    /* boolean value for override-redirect */
  367.     Screen *screen;        /* back pointer to correct screen */
  368. } XWindowAttributes;
  369.  
  370. /*
  371.  * Data structure for host setting; getting routines.
  372.  *
  373.  */
  374.  
  375. typedef struct _XHostAddress { /* Tagged. POHC 90/10/08 */
  376.     int family;        /* for example AF_DNET */
  377.     int length;        /* length of address, in bytes */
  378.     char *address;        /* pointer to where to find the bytes */
  379. } XHostAddress;
  380.  
  381. /*
  382.  * Data structure for "image" data, used by image manipulation routines.
  383.  */
  384. typedef struct _XImage {
  385.     int width, height;        /* size of image */
  386.     int xoffset;        /* number of pixels offset in X direction */
  387.     int format;            /* XYBitmap, XYPixmap, ZPixmap */
  388.     char *data;            /* pointer to image data */
  389.     int byte_order;        /* data byte order, LSBFirst, MSBFirst */
  390.     int bitmap_unit;        /* quant. of scanline 8, 16, 32 */
  391.     int bitmap_bit_order;    /* LSBFirst, MSBFirst */
  392.     int bitmap_pad;        /* 8, 16, 32 either XY or ZPixmap */
  393.     int depth;            /* depth of image */
  394.     int bytes_per_line;        /* accelarator to next line */
  395.     int bits_per_pixel;        /* bits per pixel (ZPixmap) */
  396.     unsigned long red_mask;    /* bits in z arrangment */
  397.     unsigned long green_mask;
  398.     unsigned long blue_mask;
  399.     char *obdata;        /* hook for the object routines to hang on */
  400.     struct funcs {        /* image manipulation routines */
  401. #if NeedFunctionPtrPrototypes /* POHC 91/04/16 */
  402.     struct _XImage *(*create_image)(struct _XDisplay *, Visual *, unsigned int, /* POHC 91/04/16 */
  403.         int, int, char *, unsigned int, unsigned int, int, int);
  404. #else
  405.     struct _XImage *(*create_image)();
  406. #endif
  407. #if NeedFunctionPrototypes
  408.     int (*destroy_image)        (struct _XImage *);
  409.     unsigned long (*get_pixel)  (struct _XImage *, int, int);
  410.     int (*put_pixel)            (struct _XImage *, int, int, unsigned long);
  411.     struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int);
  412.     int (*add_pixel)            (struct _XImage *, long);
  413. #else
  414.     int (*destroy_image)();
  415.     unsigned long (*get_pixel)();
  416.     int (*put_pixel)();
  417.     struct _XImage *(*sub_image)();
  418.     int (*add_pixel)();
  419. #endif
  420.     } f;
  421. } XImage;
  422.  
  423. /* 
  424.  * Data structure for XReconfigureWindow
  425.  */
  426. typedef struct _XWindowChanges { /* Tagged. POHC 90/10/08 */
  427.     int x, y;
  428.     int width, height;
  429.     int border_width;
  430.     Window sibling;
  431.     int stack_mode;
  432. } XWindowChanges;
  433.  
  434. /*
  435.  * Data structure used by color operations
  436.  */
  437. typedef struct _XColor { /* Tagged. POHC 90/10/08 */
  438.     unsigned long pixel;
  439.     unsigned short red, green, blue;
  440.     char flags;  /* do_red, do_green, do_blue */
  441.     char pad;
  442. } XColor;
  443.  
  444. /* 
  445.  * Data structures for graphics operations.  On most machines, these are
  446.  * congruent with the wire protocol structures, so reformatting the data
  447.  * can be avoided on these architectures.
  448.  */
  449. typedef struct _XSegment { /* Tagged. POHC 90/10/08 */
  450.     short x1, y1, x2, y2;
  451. } XSegment;
  452.  
  453. typedef struct _XPoint { /* Tagged. POHC 90/10/08 */
  454.     short x, y;
  455. } XPoint;
  456.     
  457. typedef struct _XRectangle { /* Tagged. POHC 90/10/08 */
  458.     short x, y;
  459.     unsigned short width, height;
  460. } XRectangle;
  461.     
  462. typedef struct _XArc { /* Tagged. POHC 90/10/08 */
  463.     short x, y;
  464.     unsigned short width, height;
  465.     short angle1, angle2;
  466. } XArc;
  467.  
  468.  
  469. /* Data structure for XChangeKeyboardControl */
  470.  
  471. typedef struct _XKeyboardControl { /* Tagged. POHC 90/10/08 */
  472.         int key_click_percent;
  473.         int bell_percent;
  474.         int bell_pitch;
  475.         int bell_duration;
  476.         int led;
  477.         int led_mode;
  478.         int key;
  479.         int auto_repeat_mode;   /* On, Off, Default */
  480. } XKeyboardControl;
  481.  
  482. /* Data structure for XGetKeyboardControl */
  483.  
  484. typedef struct _XKeyboardState { /* Tagged. POHC 90/10/08 */
  485.         int key_click_percent;
  486.     int bell_percent;
  487.     unsigned int bell_pitch, bell_duration;
  488.     unsigned long led_mask;
  489.     int global_auto_repeat;
  490.     char auto_repeats[32];
  491. } XKeyboardState;
  492.  
  493. /* Data structure for XGetMotionEvents.  */
  494.  
  495. typedef struct _XTimeCoord { /* Tagged. POHC 90/10/08 */
  496.         Time time;
  497.     short x, y;
  498. } XTimeCoord;
  499.  
  500. /* Data structure for X{Set,Get}ModifierMapping */
  501.  
  502. typedef struct _XModifierKeymap { /* Tagged. POHC 90/10/08 */
  503.      int max_keypermod;    /* The server's max # of keys per modifier */
  504.      KeyCode *modifiermap;    /* An 8 by max_keypermod array of modifiers */
  505. } XModifierKeymap;
  506.  
  507. #endif /* _XSTRUCT_ */
  508.  
  509.  
  510.  
  511. /*
  512.  * internal atoms used for ICCCM things; not to be used by client
  513.  */
  514.  
  515. struct _DisplayAtoms {
  516.     Atom text;
  517.     Atom wm_state;
  518.     Atom wm_protocols;
  519.     Atom wm_save_yourself;
  520.     Atom wm_change_state;
  521.     Atom wm_colormap_windows;
  522.     /* add new atoms to end of list */
  523. };
  524.  
  525.  
  526. /*
  527.  * Display datatype maintaining display specific data.
  528.  */
  529. typedef struct _XDisplay {
  530.     XExtData *ext_data;    /* hook for extension to hang data */
  531.     struct _XDisplay *next; /* next open Display on list */
  532.     int fd;            /* Network socket. */
  533.     int lock;        /* is someone in critical section? */
  534.     int proto_major_version;/* maj. version of server's X protocol */
  535.     int proto_minor_version;/* minor version of servers X protocol */
  536.     char *vendor;        /* vendor of the server hardware */
  537.         long resource_base;    /* resource ID base */
  538.     long resource_mask;    /* resource ID mask bits */
  539.     long resource_id;    /* allocator current ID */
  540.     int resource_shift;    /* allocator shift to correct bits */
  541.     XID (*resource_alloc)(
  542. #if NeedFunctionPtrPrototypes /* POHC 92/12/29 */
  543.              struct _XDisplay * /* POHC 91/04/16 */
  544. #endif
  545.             ); /* allocator function */
  546.     int byte_order;        /* screen byte order, LSBFirst, MSBFirst */
  547.     int bitmap_unit;    /* padding and data requirements */
  548.     int bitmap_pad;        /* padding requirements on bitmaps */
  549.     int bitmap_bit_order;    /* LeastSignificant or MostSignificant */
  550.     int nformats;        /* number of pixmap formats in list */
  551.     ScreenFormat *pixmap_format;    /* pixmap format list */
  552.     int vnumber;        /* Xlib's X protocol version number. */
  553.     int release;        /* release of the server */
  554.     struct _XSQEvent *head, *tail;    /* Input event queue. */
  555.     int qlen;        /* Length of input event queue */
  556.     unsigned long last_request_read; /* seq number of last event read */
  557.     unsigned long request;    /* sequence number of last request. */
  558.     char *last_req;        /* beginning of last request, or dummy */
  559.     char *buffer;        /* Output buffer starting address. */
  560.     char *bufptr;        /* Output buffer index pointer. */
  561.     char *bufmax;        /* Output buffer maximum+1 address. */
  562.     unsigned max_request_size; /* maximum number 32 bit words in request*/
  563.     struct _XrmHashBucketRec *db;
  564.     int (*synchandler)(
  565. #if NeedFunctionPtrPrototypes /* POHC 92/12/29 */
  566.                struct _XDisplay * /* POHC 91/04/16 */
  567. #endif
  568.               );    /* Synchronization handler */
  569.     char *display_name;    /* "host:display" string used on this connect*/
  570.     int default_screen;    /* default screen for operations */
  571.     int nscreens;        /* number of screens on this server*/
  572.     Screen *screens;    /* pointer to list of screens */
  573.     unsigned long motion_buffer;    /* size of motion buffer */
  574.     Window current;        /* for use internally for Keymap notify */
  575.     int min_keycode;    /* minimum defined keycode */
  576.     int max_keycode;    /* maximum defined keycode */
  577.     KeySym *keysyms;    /* This server's keysyms */
  578.     XModifierKeymap *modifiermap;    /* This server's modifier keymap */
  579.     int keysyms_per_keycode;/* number of rows */
  580.     char *xdefaults;    /* contents of defaults from server */
  581.     char *scratch_buffer;    /* place to hang scratch buffer */
  582.     unsigned long scratch_length;    /* length of scratch buffer */
  583.     int ext_number;        /* extension number on this display */
  584.     _XExtension *ext_procs;    /* extensions initialized on this display */
  585.     /*
  586.      * the following can be fixed size, as the protocol defines how
  587.      * much address space is available. 
  588.      * While this could be done using the extension vector, there
  589.      * may be MANY events processed, so a search through the extension
  590.      * list to find the right procedure for each event might be
  591.      * expensive if many extensions are being used.
  592.      */
  593. #if NeedFunctionPtrPrototypes /* POHC 91/04/16 */
  594.     Bool (*event_vec[128])(struct _XDisplay *, union _XEvent *, struct _xEvent *);  /* vector for wire to event */
  595.     Status (*wire_vec[128])(struct _XDisplay *, union _XEvent *, struct _xEvent *); /* vector for event to wire */
  596. #else
  597.     Bool (*event_vec[128])();  /* vector for wire to event */
  598.     Status (*wire_vec[128])(); /* vector for event to wire */
  599. #endif
  600.     KeySym lock_meaning;       /* for XLookupString */
  601.     struct XKeytrans *key_bindings; /* for XLookupString */
  602.     Font cursor_font;       /* for XCreateFontCursor */
  603.     /*
  604.      * ICCCM information, version 1
  605.      */
  606.     struct _DisplayAtoms *atoms;
  607.     struct {           /* for XReconfigureWMWindow */
  608.         long sequence_number;
  609.         int (*old_handler)(
  610. #if NeedFunctionPtrPrototypes /* POHC 91/04/16 */
  611. struct _XDisplay *, struct _XErrorEvent * /* POHC 91/04/16 */
  612. #endif
  613. );
  614.         Bool succeeded;
  615.     } reconfigure_wm_window;
  616.     /*
  617.      * additional connection info
  618.      */
  619.     unsigned long flags;       /* internal connection flags */
  620.     unsigned int mode_switch;  /* keyboard group modifiers */
  621. } Display;
  622.  
  623. #if (NeedFunctionPrototypes || NeedFunctionPtrPrototypes) /* POHC 91/04/16 */
  624.     /* prototypes require event type definitions */
  625. #undef _XEVENT_
  626. #endif
  627. #ifndef _XEVENT_
  628. /*
  629.  * A "XEvent" structure always  has type as the first entry.  This 
  630.  * uniquely identifies what  kind of event it is.  The second entry
  631.  * is always a pointer to the display the event was read from.
  632.  * The third entry is always a window of one type or another,
  633.  * carefully selected to be useful to toolkit dispatchers.  (Except
  634.  * for keymap events, which have no window.) You
  635.  * must not change the order of the three elements or toolkits will
  636.  * break! The pointer to the generic event must be cast before use to 
  637.  * access any other information in the structure.
  638.  */
  639.  
  640. /*
  641.  * Definitions of specific events.
  642.  */
  643. typedef struct _XKeyEvent { /* Tagged. POHC 90/10/08 */
  644.     int type;        /* of event */
  645.     unsigned long serial;    /* # of last request processed by server */
  646.     Bool send_event;    /* true if this came from a SendEvent request */
  647.     Display *display;    /* Display the event was read from */
  648.     Window window;            /* "event" window it is reported relative to */
  649.     Window root;            /* root window that the event occured on */
  650.     Window subwindow;    /* child window */
  651.     Time time;        /* milliseconds */
  652.     int x, y;        /* pointer x, y coordinates in event window */
  653.     int x_root, y_root;    /* coordinates relative to root */
  654.     unsigned int state;    /* key or button mask */
  655.     unsigned int keycode;    /* detail */
  656.     Bool same_screen;    /* same screen flag */
  657. } XKeyEvent;
  658. typedef XKeyEvent XKeyPressedEvent;
  659. typedef XKeyEvent XKeyReleasedEvent;
  660.  
  661. typedef struct _XButtonEvent { /* Tagged. POHC 90/10/08 */
  662.     int type;        /* of event */
  663.     unsigned long serial;    /* # of last request processed by server */
  664.     Bool send_event;    /* true if this came from a SendEvent request */
  665.     Display *display;    /* Display the event was read from */
  666.     Window window;            /* "event" window it is reported relative to */
  667.     Window root;            /* root window that the event occured on */
  668.     Window subwindow;    /* child window */
  669.     Time time;        /* milliseconds */
  670.     int x, y;        /* pointer x, y coordinates in event window */
  671.     int x_root, y_root;    /* coordinates relative to root */
  672.     unsigned int state;    /* key or button mask */
  673.     unsigned int button;    /* detail */
  674.     Bool same_screen;    /* same screen flag */
  675. } XButtonEvent;
  676. typedef XButtonEvent XButtonPressedEvent;
  677. typedef XButtonEvent XButtonReleasedEvent;
  678.  
  679. typedef struct _XMotionEvent { /* Tagged. POHC 90/10/08 */
  680.     int type;        /* of event */
  681.     unsigned long serial;    /* # of last request processed by server */
  682.     Bool send_event;    /* true if this came from a SendEvent request */
  683.     Display *display;    /* Display the event was read from */
  684.     Window window;            /* "event" window reported relative to */
  685.     Window root;            /* root window that the event occured on */
  686.     Window subwindow;    /* child window */
  687.     Time time;        /* milliseconds */
  688.     int x, y;        /* pointer x, y coordinates in event window */
  689.     int x_root, y_root;    /* coordinates relative to root */
  690.     unsigned int state;    /* key or button mask */
  691.     char is_hint;        /* detail */
  692.     Bool same_screen;    /* same screen flag */
  693. } XMotionEvent;
  694. typedef XMotionEvent XPointerMovedEvent;
  695.  
  696. typedef struct _XCrossingEvent { /* Tagged. POHC 90/10/08 */
  697.     int type;        /* of event */
  698.     unsigned long serial;    /* # of last request processed by server */
  699.     Bool send_event;    /* true if this came from a SendEvent request */
  700.     Display *display;    /* Display the event was read from */
  701.     Window window;            /* "event" window reported relative to */
  702.     Window root;            /* root window that the event occured on */
  703.     Window subwindow;    /* child window */
  704.     Time time;        /* milliseconds */
  705.     int x, y;        /* pointer x, y coordinates in event window */
  706.     int x_root, y_root;    /* coordinates relative to root */
  707.     int mode;        /* NotifyNormal, NotifyGrab, NotifyUngrab */
  708.     int detail;
  709.     /*
  710.      * NotifyAncestor, NotifyVirtual, NotifyInferior, 
  711.      * NotifyNonLinear,NotifyNonLinearVirtual
  712.      */
  713.     Bool same_screen;    /* same screen flag */
  714.     Bool focus;        /* boolean focus */
  715.     unsigned int state;    /* key or button mask */
  716. } XCrossingEvent;
  717. typedef XCrossingEvent XEnterWindowEvent;
  718. typedef XCrossingEvent XLeaveWindowEvent;
  719.  
  720. typedef struct _XFocusChangeEvent { /* Tagged. POHC 90/10/08 */
  721.     int type;        /* FocusIn or FocusOut */
  722.     unsigned long serial;    /* # of last request processed by server */
  723.     Bool send_event;    /* true if this came from a SendEvent request */
  724.     Display *display;    /* Display the event was read from */
  725.     Window window;        /* window of event */
  726.     int mode;        /* NotifyNormal, NotifyGrab, NotifyUngrab */
  727.     int detail;
  728.     /*
  729.      * NotifyAncestor, NotifyVirtual, NotifyInferior, 
  730.      * NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer,
  731.      * NotifyPointerRoot, NotifyDetailNone 
  732.      */
  733. } XFocusChangeEvent;
  734. typedef XFocusChangeEvent XFocusInEvent;
  735. typedef XFocusChangeEvent XFocusOutEvent;
  736.  
  737. /* generated on EnterWindow and FocusIn  when KeyMapState selected */
  738. typedef struct _XKeymapEvent { /* Tagged. POHC 90/10/08 */
  739.     int type;
  740.     unsigned long serial;    /* # of last request processed by server */
  741.     Bool send_event;    /* true if this came from a SendEvent request */
  742.     Display *display;    /* Display the event was read from */
  743.     Window window;
  744.     char key_vector[32];
  745. } XKeymapEvent;    
  746.  
  747. typedef struct _XExposeEvent { /* Tagged. POHC 90/10/08 */
  748.     int type;
  749.     unsigned long serial;    /* # of last request processed by server */
  750.     Bool send_event;    /* true if this came from a SendEvent request */
  751.     Display *display;    /* Display the event was read from */
  752.     Window window;
  753.     int x, y;
  754.     int width, height;
  755.     int count;        /* if non-zero, at least this many more */
  756. } XExposeEvent;
  757.  
  758. typedef struct _XGraphicsExposeEvent { /* Tagged. POHC 90/10/08 */
  759.     int type;
  760.     unsigned long serial;    /* # of last request processed by server */
  761.     Bool send_event;    /* true if this came from a SendEvent request */
  762.     Display *display;    /* Display the event was read from */
  763.     Drawable drawable;
  764.     int x, y;
  765.     int width, height;
  766.     int count;        /* if non-zero, at least this many more */
  767.     int major_code;        /* core is CopyArea or CopyPlane */
  768.     int minor_code;        /* not defined in the core */
  769. } XGraphicsExposeEvent;
  770.  
  771. typedef struct _XNoExposeEvent { /* Tagged. POHC 90/10/08 */
  772.     int type;
  773.     unsigned long serial;    /* # of last request processed by server */
  774.     Bool send_event;    /* true if this came from a SendEvent request */
  775.     Display *display;    /* Display the event was read from */
  776.     Drawable drawable;
  777.     int major_code;        /* core is CopyArea or CopyPlane */
  778.     int minor_code;        /* not defined in the core */
  779. } XNoExposeEvent;
  780.  
  781. typedef struct _XVisibilityEvent { /* Tagged. POHC 90/10/08 */
  782.     int type;
  783.     unsigned long serial;    /* # of last request processed by server */
  784.     Bool send_event;    /* true if this came from a SendEvent request */
  785.     Display *display;    /* Display the event was read from */
  786.     Window window;
  787.     int state;        /* Visibility state */
  788. } XVisibilityEvent;
  789.  
  790. typedef struct _XCreateWindowEvent { /* Tagged. POHC 90/10/08 */
  791.     int type;
  792.     unsigned long serial;    /* # of last request processed by server */
  793.     Bool send_event;    /* true if this came from a SendEvent request */
  794.     Display *display;    /* Display the event was read from */
  795.     Window parent;        /* parent of the window */
  796.     Window window;        /* window id of window created */
  797.     int x, y;        /* window location */
  798.     int width, height;    /* size of window */
  799.     int border_width;    /* border width */
  800.     Bool override_redirect;    /* creation should be overridden */
  801. } XCreateWindowEvent;
  802.  
  803. typedef struct _XDestroyWindowEvent { /* Tagged. POHC 90/10/08 */
  804.     int type;
  805.     unsigned long serial;    /* # of last request processed by server */
  806.     Bool send_event;    /* true if this came from a SendEvent request */
  807.     Display *display;    /* Display the event was read from */
  808.     Window event;
  809.     Window window;
  810. } XDestroyWindowEvent;
  811.  
  812. typedef struct _XUnmapEvent { /* Tagged. POHC 90/10/08 */
  813.     int type;
  814.     unsigned long serial;    /* # of last request processed by server */
  815.     Bool send_event;    /* true if this came from a SendEvent request */
  816.     Display *display;    /* Display the event was read from */
  817.     Window event;
  818.     Window window;
  819.     Bool from_configure;
  820. } XUnmapEvent;
  821.  
  822. typedef struct _XMapEvent { /* Tagged. POHC 90/10/08 */
  823.     int type;
  824.     unsigned long serial;    /* # of last request processed by server */
  825.     Bool send_event;    /* true if this came from a SendEvent request */
  826.     Display *display;    /* Display the event was read from */
  827.     Window event;
  828.     Window window;
  829.     Bool override_redirect;    /* boolean, is override set... */
  830. } XMapEvent;
  831.  
  832. typedef struct _XMapRequestEvent { /* Tagged. POHC 90/10/08 */
  833.     int type;
  834.     unsigned long serial;    /* # of last request processed by server */
  835.     Bool send_event;    /* true if this came from a SendEvent request */
  836.     Display *display;    /* Display the event was read from */
  837.     Window parent;
  838.     Window window;
  839. } XMapRequestEvent;
  840.  
  841. typedef struct _XReparentEvent { /* Tagged. POHC 90/10/08 */
  842.     int type;
  843.     unsigned long serial;    /* # of last request processed by server */
  844.     Bool send_event;    /* true if this came from a SendEvent request */
  845.     Display *display;    /* Display the event was read from */
  846.     Window event;
  847.     Window window;
  848.     Window parent;
  849.     int x, y;
  850.     Bool override_redirect;
  851. } XReparentEvent;
  852.  
  853. typedef struct _XConfigureEvent { /* Tagged. POHC 90/10/08 */
  854.     int type;
  855.     unsigned long serial;    /* # of last request processed by server */
  856.     Bool send_event;    /* true if this came from a SendEvent request */
  857.     Display *display;    /* Display the event was read from */
  858.     Window event;
  859.     Window window;
  860.     int x, y;
  861.     int width, height;
  862.     int border_width;
  863.     Window above;
  864.     Bool override_redirect;
  865. } XConfigureEvent;
  866.  
  867. typedef struct _XGravityEvent { /* Tagged. POHC 90/10/08 */
  868.     int type;
  869.     unsigned long serial;    /* # of last request processed by server */
  870.     Bool send_event;    /* true if this came from a SendEvent request */
  871.     Display *display;    /* Display the event was read from */
  872.     Window event;
  873.     Window window;
  874.     int x, y;
  875. } XGravityEvent;
  876.  
  877. typedef struct _XResizeRequestEvent { /* Tagged. POHC 90/10/08 */
  878.     int type;
  879.     unsigned long serial;    /* # of last request processed by server */
  880.     Bool send_event;    /* true if this came from a SendEvent request */
  881.     Display *display;    /* Display the event was read from */
  882.     Window window;
  883.     int width, height;
  884. } XResizeRequestEvent;
  885.  
  886. typedef struct _XConfigureRequestEvent { /* Tagged. POHC 90/10/08 */
  887.     int type;
  888.     unsigned long serial;    /* # of last request processed by server */
  889.     Bool send_event;    /* true if this came from a SendEvent request */
  890.     Display *display;    /* Display the event was read from */
  891.     Window parent;
  892.     Window window;
  893.     int x, y;
  894.     int width, height;
  895.     int border_width;
  896.     Window above;
  897.     int detail;        /* Above, Below, TopIf, BottomIf, Opposite */
  898.     unsigned long value_mask;
  899. } XConfigureRequestEvent;
  900.  
  901. typedef struct _XCirculateEvent { /* Tagged. POHC 90/10/08 */
  902.     int type;
  903.     unsigned long serial;    /* # of last request processed by server */
  904.     Bool send_event;    /* true if this came from a SendEvent request */
  905.     Display *display;    /* Display the event was read from */
  906.     Window event;
  907.     Window window;
  908.     int place;        /* PlaceOnTop, PlaceOnBottom */
  909. } XCirculateEvent;
  910.  
  911. typedef struct _XCirculateRequestEvent { /* Tagged. POHC 90/10/08 */
  912.     int type;
  913.     unsigned long serial;    /* # of last request processed by server */
  914.     Bool send_event;    /* true if this came from a SendEvent request */
  915.     Display *display;    /* Display the event was read from */
  916.     Window parent;
  917.     Window window;
  918.     int place;        /* PlaceOnTop, PlaceOnBottom */
  919. } XCirculateRequestEvent;
  920.  
  921. typedef struct _XPropertyEvent { /* Tagged. POHC 90/10/08 */
  922.     int type;
  923.     unsigned long serial;    /* # of last request processed by server */
  924.     Bool send_event;    /* true if this came from a SendEvent request */
  925.     Display *display;    /* Display the event was read from */
  926.     Window window;
  927.     Atom atom;
  928.     Time time;
  929.     int state;        /* NewValue, Deleted */
  930. } XPropertyEvent;
  931.  
  932. typedef struct _XSelectionClearEvent { /* Tagged. POHC 90/10/08 */
  933.     int type;
  934.     unsigned long serial;    /* # of last request processed by server */
  935.     Bool send_event;    /* true if this came from a SendEvent request */
  936.     Display *display;    /* Display the event was read from */
  937.     Window window;
  938.     Atom selection;
  939.     Time time;
  940. } XSelectionClearEvent;
  941.  
  942. typedef struct _XSelectionRequestEvent { /* Tagged. POHC 90/10/08 */
  943.     int type;
  944.     unsigned long serial;    /* # of last request processed by server */
  945.     Bool send_event;    /* true if this came from a SendEvent request */
  946.     Display *display;    /* Display the event was read from */
  947.     Window owner;
  948.     Window requestor;
  949.     Atom selection;
  950.     Atom target;
  951.     Atom property;
  952.     Time time;
  953. } XSelectionRequestEvent;
  954.  
  955. typedef struct _XSelectionEvent { /* Tagged. POHC 90/10/08 */
  956.     int type;
  957.     unsigned long serial;    /* # of last request processed by server */
  958.     Bool send_event;    /* true if this came from a SendEvent request */
  959.     Display *display;    /* Display the event was read from */
  960.     Window requestor;
  961.     Atom selection;
  962.     Atom target;
  963.     Atom property;        /* ATOM or None */
  964.     Time time;
  965. } XSelectionEvent;
  966.  
  967. typedef struct _XColormapEvent { /* Tagged. POHC 90/10/08 */
  968.     int type;
  969.     unsigned long serial;    /* # of last request processed by server */
  970.     Bool send_event;    /* true if this came from a SendEvent request */
  971.     Display *display;    /* Display the event was read from */
  972.     Window window;
  973.     Colormap colormap;    /* COLORMAP or None */
  974. #if defined(__cplusplus) || defined(c_plusplus)
  975.     Bool c_new;        /* C++ */
  976. #else
  977.     Bool new;
  978. #endif
  979.     int state;        /* ColormapInstalled, ColormapUninstalled */
  980. } XColormapEvent;
  981.  
  982. typedef struct _XClientMessageEvent { /* Tagged. POHC 90/10/08 */
  983.     int type;
  984.     unsigned long serial;    /* # of last request processed by server */
  985.     Bool send_event;    /* true if this came from a SendEvent request */
  986.     Display *display;    /* Display the event was read from */
  987.     Window window;
  988.     Atom message_type;
  989.     int format;
  990.     union {
  991.         char b[20];
  992.         short s[10];
  993.         long l[5];
  994.         } data;
  995. } XClientMessageEvent;
  996.  
  997. typedef struct _XMappingEvent { /* Tagged. POHC 90/10/08 */
  998.     int type;
  999.     unsigned long serial;    /* # of last request processed by server */
  1000.     Bool send_event;    /* true if this came from a SendEvent request */
  1001.     Display *display;    /* Display the event was read from */
  1002.     Window window;        /* unused */
  1003.     int request;        /* one of MappingModifier, MappingKeyboard,
  1004.                    MappingPointer */
  1005.     int first_keycode;    /* first keycode */
  1006.     int count;        /* defines range of change w. first_keycode*/
  1007. } XMappingEvent;
  1008.  
  1009. typedef struct _XErrorEvent { /* Tagged. POHC 90/10/08 */
  1010.     int type;
  1011.     Display *display;    /* Display the event was read from */
  1012.     XID resourceid;        /* resource id */
  1013.     unsigned long serial;    /* serial number of failed request */
  1014.     unsigned char error_code;    /* error code of failed request */
  1015.     unsigned char request_code;    /* Major op-code of failed request */
  1016.     unsigned char minor_code;    /* Minor op-code of failed request */
  1017. } XErrorEvent;
  1018.  
  1019. typedef struct _XAnyEvent { /* Tagged. POHC 90/10/08 */
  1020.     int type;
  1021.     unsigned long serial;    /* # of last request processed by server */
  1022.     Bool send_event;    /* true if this came from a SendEvent request */
  1023.     Display *display;/* Display the event was read from */
  1024.     Window window;    /* window on which event was requested in event mask */
  1025. } XAnyEvent;
  1026.  
  1027. /*
  1028.  * this union is defined so Xlib can always use the same sized
  1029.  * event structure internally, to avoid memory fragmentation.
  1030.  */
  1031. typedef union _XEvent {
  1032.         int type;        /* must not be changed; first element */
  1033.     XAnyEvent xany;
  1034.     XKeyEvent xkey;
  1035.     XButtonEvent xbutton;
  1036.     XMotionEvent xmotion;
  1037.     XCrossingEvent xcrossing;
  1038.     XFocusChangeEvent xfocus;
  1039.     XExposeEvent xexpose;
  1040.     XGraphicsExposeEvent xgraphicsexpose;
  1041.     XNoExposeEvent xnoexpose;
  1042.     XVisibilityEvent xvisibility;
  1043.     XCreateWindowEvent xcreatewindow;
  1044.     XDestroyWindowEvent xdestroywindow;
  1045.     XUnmapEvent xunmap;
  1046.     XMapEvent xmap;
  1047.     XMapRequestEvent xmaprequest;
  1048.     XReparentEvent xreparent;
  1049.     XConfigureEvent xconfigure;
  1050.     XGravityEvent xgravity;
  1051.     XResizeRequestEvent xresizerequest;
  1052.     XConfigureRequestEvent xconfigurerequest;
  1053.     XCirculateEvent xcirculate;
  1054.     XCirculateRequestEvent xcirculaterequest;
  1055.     XPropertyEvent xproperty;
  1056.     XSelectionClearEvent xselectionclear;
  1057.     XSelectionRequestEvent xselectionrequest;
  1058.     XSelectionEvent xselection;
  1059.     XColormapEvent xcolormap;
  1060.     XClientMessageEvent xclient;
  1061.     XMappingEvent xmapping;
  1062.     XErrorEvent xerror;
  1063.     XKeymapEvent xkeymap;
  1064.     long pad[24];
  1065. } XEvent;
  1066. /*
  1067.  * _QEvent datatype for use in input queueing.
  1068.  */
  1069. typedef struct _XSQEvent {
  1070.     struct _XSQEvent *next;
  1071.     XEvent event;
  1072. } _XQEvent;
  1073. #endif
  1074. #define XAllocID(dpy) ((*(dpy)->resource_alloc)((dpy)))
  1075. #ifndef _XSTRUCT_
  1076.  
  1077. /*
  1078.  * per character font metric information.
  1079.  */
  1080. typedef struct _XCharStruct { /* Tagged. POHC 90/10/08 */
  1081.     short    lbearing;    /* origin to left edge of raster */
  1082.     short    rbearing;    /* origin to right edge of raster */
  1083.     short    width;        /* advance to next char's origin */
  1084.     short    ascent;        /* baseline to top edge of raster */
  1085.     short    descent;    /* baseline to bottom edge of raster */
  1086.     unsigned short attributes;    /* per char flags (not predefined) */
  1087. } XCharStruct;
  1088.  
  1089. /*
  1090.  * To allow arbitrary information with fonts, there are additional properties
  1091.  * returned.
  1092.  */
  1093. typedef struct _XFontProp { /* Tagged. POHC 90/10/08 */
  1094.     Atom name;
  1095.     unsigned long card32;
  1096. } XFontProp;
  1097.  
  1098. typedef struct _XFontStruct { /* Tagged. POHC 90/10/08 */
  1099.     XExtData    *ext_data;    /* hook for extension to hang data */
  1100.     Font        fid;            /* Font id for this font */
  1101.     unsigned    direction;    /* hint about direction the font is painted */
  1102.     unsigned    min_char_or_byte2;/* first character */
  1103.     unsigned    max_char_or_byte2;/* last character */
  1104.     unsigned    min_byte1;    /* first row that exists */
  1105.     unsigned    max_byte1;    /* last row that exists */
  1106.     Bool    all_chars_exist;/* flag if all characters have non-zero size*/
  1107.     unsigned    default_char;    /* char to print for undefined character */
  1108.     int         n_properties;   /* how many properties there are */
  1109.     XFontProp    *properties;    /* pointer to array of additional properties*/
  1110.     XCharStruct    min_bounds;    /* minimum bounds over all existing char*/
  1111.     XCharStruct    max_bounds;    /* maximum bounds over all existing char*/
  1112.     XCharStruct    *per_char;    /* first_char to last_char information */
  1113.     int        ascent;        /* log. extent above baseline for spacing */
  1114.     int        descent;    /* log. descent below baseline for spacing */
  1115. } XFontStruct;
  1116.  
  1117. /*
  1118.  * PolyText routines take these as arguments.
  1119.  */
  1120. typedef struct _XTextItem { /* Tagged. POHC 90/10/08 */
  1121.     char *chars;        /* pointer to string */
  1122.     int nchars;            /* number of characters */
  1123.     int delta;            /* delta between strings */
  1124.     Font font;            /* font to print it in, None don't change */
  1125. } XTextItem;
  1126.  
  1127. typedef struct _XChar2b { /* Tagged. POHC 90/10/08 */        /* normal 16 bit characters are two bytes */
  1128.     unsigned char byte1;
  1129.     unsigned char byte2;
  1130. } XChar2b;
  1131.  
  1132. typedef struct _XTextItem16 { /* Tagged. POHC 90/10/08 */
  1133.     XChar2b *chars;        /* two byte characters */
  1134.     int nchars;            /* number of characters */
  1135.     int delta;            /* delta between strings */
  1136.     Font font;            /* font to print it in, None don't change */
  1137. } XTextItem16;
  1138.  
  1139.  
  1140. typedef union _XEDataObject { /* Tagged. POHC 90/10/08 */ Display *display;
  1141.         GC gc;
  1142.         Visual *visual;
  1143.         Screen *screen;
  1144.         ScreenFormat *pixmap_format;
  1145.         XFontStruct *font; } XEDataObject;
  1146.  
  1147. extern XFontStruct *XLoadQueryFont(
  1148. #if NeedFunctionPrototypes
  1149.     Display*        /* display */,
  1150.     const char*        /* name */
  1151. #endif
  1152. );
  1153.  
  1154. extern XFontStruct *XQueryFont(
  1155. #if NeedFunctionPrototypes
  1156.     Display*        /* display */,
  1157.     XID            /* font_ID */
  1158. #endif
  1159. );
  1160.  
  1161.  
  1162. extern XTimeCoord *XGetMotionEvents(
  1163. #if NeedFunctionPrototypes
  1164.     Display*        /* display */,
  1165.     Window        /* w */,
  1166.     Time        /* start */,
  1167.     Time        /* stop */,
  1168.     int*        /* nevents_return */
  1169. #endif
  1170. );
  1171.  
  1172. extern XModifierKeymap *XDeleteModifiermapEntry(
  1173. #if NeedFunctionPrototypes
  1174.     XModifierKeymap*    /* modmap */,
  1175. #if NeedWidePrototypes
  1176.     unsigned int    /* keycode_entry */,
  1177. #else
  1178.     KeyCode        /* keycode_entry */,
  1179. #endif
  1180.     int            /* modifier */
  1181. #endif
  1182. );
  1183.  
  1184. extern XModifierKeymap    *XGetModifierMapping(
  1185. #if NeedFunctionPrototypes
  1186.     Display*        /* display */
  1187. #endif
  1188. );
  1189.  
  1190. extern XModifierKeymap    *XInsertModifiermapEntry(
  1191. #if NeedFunctionPrototypes
  1192.     XModifierKeymap*    /* modmap */,
  1193. #if NeedWidePrototypes
  1194.     unsigned int    /* keycode_entry */,
  1195. #else
  1196.     KeyCode        /* keycode_entry */,
  1197. #endif
  1198.     int            /* modifier */    
  1199. #endif
  1200. );
  1201.  
  1202. extern XModifierKeymap *XNewModifiermap(
  1203. #if NeedFunctionPrototypes
  1204.     int            /* max_keys_per_mod */
  1205. #endif
  1206. );
  1207.  
  1208. extern XImage *XCreateImage(
  1209. #if NeedFunctionPrototypes
  1210.     Display*        /* display */,
  1211.     Visual*        /* visual */,
  1212.     unsigned int    /* depth */,
  1213.     int            /* format */,
  1214.     int            /* offset */,
  1215.     char*        /* data */,
  1216.     unsigned int    /* width */,
  1217.     unsigned int    /* height */,
  1218.     int            /* bitmap_pad */,
  1219.     int            /* bytes_per_line */
  1220. #endif
  1221. );
  1222. extern XImage *XGetImage(
  1223. #if NeedFunctionPrototypes
  1224.     Display*        /* display */,
  1225.     Drawable        /* d */,
  1226.     int            /* x */,
  1227.     int            /* y */,
  1228.     unsigned int    /* width */,
  1229.     unsigned int    /* height */,
  1230.     unsigned long    /* plane_mask */,
  1231.     int            /* format */
  1232. #endif
  1233. );
  1234. extern XImage *XGetSubImage(
  1235. #if NeedFunctionPrototypes
  1236.     Display*        /* display */,
  1237.     Drawable        /* d */,
  1238.     int            /* x */,
  1239.     int            /* y */,
  1240.     unsigned int    /* width */,
  1241.     unsigned int    /* height */,
  1242.     unsigned long    /* plane_mask */,
  1243.     int            /* format */,
  1244.     XImage*        /* dest_image */,
  1245.     int            /* dest_x */,
  1246.     int            /* dest_y */
  1247. #endif
  1248. );
  1249.  
  1250. #endif    /* _XSTRUCT_ */
  1251. /* 
  1252.  * X function declarations.
  1253.  */
  1254. extern Display *XOpenDisplay(
  1255. #if NeedFunctionPrototypes
  1256.     const char*        /* display_name */
  1257. #endif
  1258. );
  1259.  
  1260. extern void XrmInitialize(
  1261. #if NeedFunctionPrototypes
  1262.     void
  1263. #endif
  1264. );
  1265.  
  1266. extern char *XFetchBytes(
  1267. #if NeedFunctionPrototypes
  1268.     Display*        /* display */,
  1269.     int*        /* nbytes_return */
  1270. #endif
  1271. );
  1272. extern char *XFetchBuffer(
  1273. #if NeedFunctionPrototypes
  1274.     Display*        /* display */,
  1275.     int*        /* nbytes_return */,
  1276.     int            /* buffer */
  1277. #endif
  1278. );
  1279. extern char *XGetAtomName(
  1280. #if NeedFunctionPrototypes
  1281.     Display*        /* display */,
  1282.     Atom        /* atom */
  1283. #endif
  1284. );
  1285. extern char *XGetDefault(
  1286. #if NeedFunctionPrototypes
  1287.     Display*        /* display */,
  1288.     const char*        /* program */,
  1289.     const char*        /* option */          
  1290. #endif
  1291. );
  1292. extern char *XDisplayName(
  1293. #if NeedFunctionPrototypes
  1294.     const char*        /* string */
  1295. #endif
  1296. );
  1297. extern char *XKeysymToString(
  1298. #if NeedFunctionPrototypes
  1299.     KeySym        /* keysym */
  1300. #endif
  1301. );
  1302.  
  1303. typedef int (*XSynchronizeHandler) (    /* WARNING, this type not in Xlib spec */
  1304. #if (NeedFunctionPrototypes || NeedFunctionPtrPrototypes) /* POHC 91/04/16 */
  1305.     Display*        /* display */
  1306. #endif
  1307. );
  1308.  
  1309.  
  1310. extern XSynchronizeHandler XSynchronize(
  1311. #if NeedFunctionPrototypes
  1312.     Display*        /* display */,
  1313.     Bool        /* onoff */
  1314. #endif
  1315. );
  1316. extern XSynchronizeHandler XSetAfterFunction(
  1317. #if NeedFunctionPrototypes
  1318.     Display*        /* display */,
  1319.     XSynchronizeHandler    /* procedure */
  1320. #endif
  1321. );
  1322. extern Atom XInternAtom(
  1323. #if NeedFunctionPrototypes
  1324.     Display*        /* display */,
  1325.     const char*        /* atom_name */,
  1326.     Bool        /* only_if_exists */         
  1327. #endif
  1328. );
  1329. extern Colormap XCopyColormapAndFree(
  1330. #if NeedFunctionPrototypes
  1331.     Display*        /* display */,
  1332.     Colormap        /* colormap */
  1333. #endif
  1334. );
  1335. extern Colormap XCreateColormap(
  1336. #if NeedFunctionPrototypes
  1337.     Display*        /* display */,
  1338.     Window        /* w */,
  1339.     Visual*        /* visual */,
  1340.     int            /* alloc */             
  1341. #endif
  1342. );
  1343. extern Cursor XCreatePixmapCursor(
  1344. #if NeedFunctionPrototypes
  1345.     Display*        /* display */,
  1346.     Pixmap        /* source */,
  1347.     Pixmap        /* mask */,
  1348.     XColor*        /* foreground_color */,
  1349.     XColor*        /* background_color */,
  1350.     unsigned int    /* x */,
  1351.     unsigned int    /* y */               
  1352. #endif
  1353. );
  1354. extern Cursor XCreateGlyphCursor(
  1355. #if NeedFunctionPrototypes
  1356.     Display*        /* display */,
  1357.     Font        /* source_font */,
  1358.     Font        /* mask_font */,
  1359.     unsigned int    /* source_char */,
  1360.     unsigned int    /* mask_char */,
  1361.     XColor*        /* foreground_color */,
  1362.     XColor*        /* background_color */
  1363. #endif
  1364. );
  1365. extern Cursor XCreateFontCursor(
  1366. #if NeedFunctionPrototypes
  1367.     Display*        /* display */,
  1368.     unsigned int    /* shape */
  1369. #endif
  1370. );
  1371. extern Font XLoadFont(
  1372. #if NeedFunctionPrototypes
  1373.     Display*        /* display */,
  1374.     const char*        /* name */
  1375. #endif
  1376. );
  1377. extern GC XCreateGC(
  1378. #if NeedFunctionPrototypes
  1379.     Display*        /* display */,
  1380.     Drawable        /* d */,
  1381.     unsigned long    /* valuemask */,
  1382.     XGCValues*        /* values */
  1383. #endif
  1384. );
  1385. extern GContext XGContextFromGC(
  1386. #if NeedFunctionPrototypes
  1387.     GC            /* gc */
  1388. #endif
  1389. );
  1390. extern Pixmap XCreatePixmap(
  1391. #if NeedFunctionPrototypes
  1392.     Display*        /* display */,
  1393.     Drawable        /* d */,
  1394.     unsigned int    /* width */,
  1395.     unsigned int    /* height */,
  1396.     unsigned int    /* depth */                
  1397. #endif
  1398. );
  1399. extern Pixmap XCreateBitmapFromData(
  1400. #if NeedFunctionPrototypes
  1401.     Display*        /* display */,
  1402.     Drawable        /* d */,
  1403.     const char*        /* data */,
  1404.     unsigned int    /* width */,
  1405.     unsigned int    /* height */
  1406. #endif
  1407. );
  1408. extern Pixmap XCreatePixmapFromBitmapData(
  1409. #if NeedFunctionPrototypes
  1410.     Display*        /* display */,
  1411.     Drawable        /* d */,
  1412.     char*        /* data */,
  1413.     unsigned int    /* width */,
  1414.     unsigned int    /* height */,
  1415.     unsigned long    /* fg */,
  1416.     unsigned long    /* bg */,
  1417.     unsigned int    /* depth */
  1418. #endif
  1419. );
  1420. extern Window XCreateSimpleWindow(
  1421. #if NeedFunctionPrototypes
  1422.     Display*        /* display */,
  1423.     Window        /* parent */,
  1424.     int            /* x */,
  1425.     int            /* y */,
  1426.     unsigned int    /* width */,
  1427.     unsigned int    /* height */,
  1428.     unsigned int    /* border_width */,
  1429.     unsigned long    /* border */,
  1430.     unsigned long    /* background */
  1431. #endif
  1432. );
  1433. extern Window XGetSelectionOwner(
  1434. #if NeedFunctionPrototypes
  1435.     Display*        /* display */,
  1436.     Atom        /* selection */
  1437. #endif
  1438. );
  1439. extern Window XCreateWindow(
  1440. #if NeedFunctionPrototypes
  1441.     Display*        /* display */,
  1442.     Window        /* parent */,
  1443.     int            /* x */,
  1444.     int            /* y */,
  1445.     unsigned int    /* width */,
  1446.     unsigned int    /* height */,
  1447.     unsigned int    /* border_width */,
  1448.     int            /* depth */,
  1449.     unsigned int    /* class */,
  1450.     Visual*        /* visual */,
  1451.     unsigned long    /* valuemask */,
  1452.     XSetWindowAttributes*    /* attributes */
  1453. #endif
  1454. ); 
  1455. extern Colormap *XListInstalledColormaps(
  1456. #if NeedFunctionPrototypes
  1457.     Display*        /* display */,
  1458.     Window        /* w */,
  1459.     int*        /* num_return */
  1460. #endif
  1461. );
  1462. extern char **XListFonts(
  1463. #if NeedFunctionPrototypes
  1464.     Display*        /* display */,
  1465.     const char*        /* pattern */,
  1466.     int            /* maxnames */,
  1467.     int*        /* actual_count_return */
  1468. #endif
  1469. );
  1470. extern char **XListFontsWithInfo(
  1471. #if NeedFunctionPrototypes
  1472.     Display*        /* display */,
  1473.     const char*        /* pattern */,
  1474.     int            /* maxnames */,
  1475.     int*        /* count_return */,
  1476.     XFontStruct**    /* info_return */
  1477. #endif
  1478. );
  1479. extern char **XGetFontPath(
  1480. #if NeedFunctionPrototypes
  1481.     Display*        /* display */,
  1482.     int*        /* npaths_return */
  1483. #endif
  1484. );
  1485. extern char **XListExtensions(
  1486. #if NeedFunctionPrototypes
  1487.     Display*        /* display */,
  1488.     int*        /* nextensions_return */
  1489. #endif
  1490. );
  1491. extern Atom *XListProperties(
  1492. #if NeedFunctionPrototypes
  1493.     Display*        /* display */,
  1494.     Window        /* w */,
  1495.     int*        /* num_prop_return */
  1496. #endif
  1497. );
  1498. extern XHostAddress *XListHosts(
  1499. #if NeedFunctionPrototypes
  1500.     Display*        /* display */,
  1501.     int*        /* nhosts_return */,
  1502.     Bool*        /* state_return */
  1503. #endif
  1504. );
  1505. extern KeySym XKeycodeToKeysym(
  1506. #if NeedFunctionPrototypes
  1507.     Display*        /* display */,
  1508. #if NeedWidePrototypes
  1509.     unsigned int    /* keycode */,
  1510. #else
  1511.     KeyCode        /* keycode */,
  1512. #endif
  1513.     int            /* index */
  1514. #endif
  1515. );
  1516. extern KeySym XLookupKeysym(
  1517. #if NeedFunctionPrototypes
  1518.     XKeyEvent*        /* key_event */,
  1519.     int            /* index */
  1520. #endif
  1521. );
  1522. extern KeySym *XGetKeyboardMapping(
  1523. #if NeedFunctionPrototypes
  1524.     Display*        /* display */,
  1525. #if NeedWidePrototypes
  1526.     unsigned int    /* first_keycode */,
  1527. #else
  1528.     KeyCode        /* first_keycode */,
  1529. #endif
  1530.     int            /* keycode_count */,
  1531.     int*        /* keysyms_per_keycode_return */
  1532. #endif
  1533. );
  1534. extern KeySym XStringToKeysym(
  1535. #if NeedFunctionPrototypes
  1536.     const char*        /* string */
  1537. #endif
  1538. );
  1539. extern long XMaxRequestSize(
  1540. #if NeedFunctionPrototypes
  1541.     Display*        /* display */
  1542. #endif
  1543. );
  1544. extern char *XResourceManagerString(
  1545. #if NeedFunctionPrototypes
  1546.     Display*        /* display */
  1547. #endif
  1548. );
  1549. extern unsigned long XDisplayMotionBufferSize(
  1550. #if NeedFunctionPrototypes
  1551.     Display*        /* display */
  1552. #endif
  1553. );
  1554. extern VisualID XVisualIDFromVisual(
  1555. #if NeedFunctionPrototypes
  1556.     Visual*        /* visual */
  1557. #endif
  1558. );
  1559.  
  1560. /* routines for dealing with extensions */
  1561.  
  1562. extern XExtCodes *XInitExtension(
  1563. #if NeedFunctionPrototypes
  1564.     Display*        /* display */,
  1565.     const char*        /* name */
  1566. #endif
  1567. );
  1568.  
  1569. extern XExtCodes *XAddExtension(
  1570. #if NeedFunctionPrototypes
  1571.     Display*        /* display */
  1572. #endif
  1573. );
  1574. extern XExtData *XFindOnExtensionList(
  1575. #if NeedFunctionPrototypes
  1576.     XExtData**        /* structure */,
  1577.     int            /* number */
  1578. #endif
  1579. );
  1580. extern XExtData **XEHeadOfExtensionList(
  1581. #if NeedFunctionPrototypes
  1582.     XEDataObject    /* object */
  1583. #endif
  1584. );
  1585.  
  1586. /* these are routines for which there are also macros */
  1587. extern Window XRootWindow(
  1588. #if NeedFunctionPrototypes
  1589.     Display*        /* display */,
  1590.     int            /* screen_number */
  1591. #endif
  1592. );
  1593. extern Window XDefaultRootWindow(
  1594. #if NeedFunctionPrototypes
  1595.     Display*        /* display */
  1596. #endif
  1597. );
  1598. extern Window XRootWindowOfScreen(
  1599. #if NeedFunctionPrototypes
  1600.     Screen*        /* screen */
  1601. #endif
  1602. );
  1603. extern Visual *XDefaultVisual(
  1604. #if NeedFunctionPrototypes
  1605.     Display*        /* display */,
  1606.     int            /* screen_number */
  1607. #endif
  1608. );
  1609. extern Visual *XDefaultVisualOfScreen(
  1610. #if NeedFunctionPrototypes
  1611.     Screen*        /* screen */
  1612. #endif
  1613. );
  1614. extern GC XDefaultGC(
  1615. #if NeedFunctionPrototypes
  1616.     Display*        /* display */,
  1617.     int            /* screen_number */
  1618. #endif
  1619. );
  1620. extern GC XDefaultGCOfScreen(
  1621. #if NeedFunctionPrototypes
  1622.     Screen*        /* screen */
  1623. #endif
  1624. );
  1625. extern unsigned long XBlackPixel(
  1626. #if NeedFunctionPrototypes
  1627.     Display*        /* display */,
  1628.     int            /* screen_number */
  1629. #endif
  1630. );
  1631. extern unsigned long XWhitePixel(
  1632. #if NeedFunctionPrototypes
  1633.     Display*        /* display */,
  1634.     int            /* screen_number */
  1635. #endif
  1636. );
  1637. extern unsigned long XAllPlanes(
  1638. #if NeedFunctionPrototypes
  1639.     void
  1640. #endif
  1641. );
  1642. extern unsigned long XBlackPixelOfScreen(
  1643. #if NeedFunctionPrototypes
  1644.     Screen*        /* screen */
  1645. #endif
  1646. );
  1647. extern unsigned long XWhitePixelOfScreen(
  1648. #if NeedFunctionPrototypes
  1649.     Screen*        /* screen */
  1650. #endif
  1651. );
  1652. extern unsigned long XNextRequest(
  1653. #if NeedFunctionPrototypes
  1654.     Display*        /* display */
  1655. #endif
  1656. );
  1657. extern unsigned long XLastKnownRequestProcessed(
  1658. #if NeedFunctionPrototypes
  1659.     Display*        /* display */
  1660. #endif
  1661. );
  1662. extern char *XServerVendor(
  1663. #if NeedFunctionPrototypes
  1664.     Display*        /* display */
  1665. #endif
  1666. );
  1667. extern char *XDisplayString(
  1668. #if NeedFunctionPrototypes
  1669.     Display*        /* display */
  1670. #endif
  1671. );
  1672. extern Colormap XDefaultColormap(
  1673. #if NeedFunctionPrototypes
  1674.     Display*        /* display */,
  1675.     int            /* screen_number */
  1676. #endif
  1677. );
  1678. extern Colormap XDefaultColormapOfScreen(
  1679. #if NeedFunctionPrototypes
  1680.     Screen*        /* screen */
  1681. #endif
  1682. );
  1683. extern Display *XDisplayOfScreen(
  1684. #if NeedFunctionPrototypes
  1685.     Screen*        /* screen */
  1686. #endif
  1687. );
  1688. extern Screen *XScreenOfDisplay(
  1689. #if NeedFunctionPrototypes
  1690.     Display*        /* display */,
  1691.     int            /* screen_number */
  1692. #endif
  1693. );
  1694. extern Screen *XDefaultScreenOfDisplay(
  1695. #if NeedFunctionPrototypes
  1696.     Display*        /* display */
  1697. #endif
  1698. );
  1699. extern long XEventMaskOfScreen(
  1700. #if NeedFunctionPrototypes
  1701.     Screen*        /* screen */
  1702. #endif
  1703. );
  1704.  
  1705. extern int XScreenNumberOfScreen(
  1706. #if NeedFunctionPrototypes
  1707.     Screen*        /* screen */
  1708. #endif
  1709. );
  1710.  
  1711. typedef int (*XErrorHandler) (        /* WARNING, this type not in Xlib spec */
  1712. #if (NeedFunctionPrototypes || NeedFunctionPtrPrototypes) /* POHC 91/04/16 */
  1713.     Display *        /* display */,
  1714.     XErrorEvent *    /* error_event */
  1715. #endif
  1716. );
  1717.  
  1718. extern XErrorHandler XSetErrorHandler (
  1719. #if NeedFunctionPrototypes
  1720.     XErrorHandler    /* handler */
  1721. #endif
  1722. );
  1723.  
  1724.  
  1725. typedef int (*XIOErrorHandler) (    /* WARNING, this type not in Xlib spec */
  1726. #if (NeedFunctionPrototypes || NeedFunctionPtrPrototypes) /* POHC 91/04/16 */
  1727.     Display*        /* display */
  1728. #endif
  1729. );
  1730.  
  1731. extern XIOErrorHandler XSetIOErrorHandler (
  1732. #if NeedFunctionPrototypes
  1733.     XIOErrorHandler    /* handler */
  1734. #endif
  1735. );
  1736.  
  1737.  
  1738. extern XPixmapFormatValues *XListPixmapFormats(
  1739. #if NeedFunctionPrototypes
  1740.     Display*        /* display */,
  1741.     int*        /* count_return */
  1742. #endif
  1743. );
  1744. extern int *XListDepths(
  1745. #if NeedFunctionPrototypes
  1746.     Display*        /* display */,
  1747.     int            /* screen_number */,
  1748.     int*        /* count_return */
  1749. #endif
  1750. );
  1751.  
  1752. /* ICCCM routines for things that don't require special include files; */
  1753. /* other declarations are given in Xutil.h                             */
  1754. extern Status XReconfigureWMWindow(
  1755. #if NeedFunctionPrototypes
  1756.     Display*        /* display */,
  1757.     Window        /* w */,
  1758.     int            /* screen_number */,
  1759.     unsigned int    /* mask */,
  1760.     XWindowChanges*    /* changes */
  1761. #endif
  1762. );
  1763.  
  1764. extern Status XGetWMProtocols(
  1765. #if NeedFunctionPrototypes
  1766.     Display*        /* display */,
  1767.     Window        /* w */,
  1768.     Atom**        /* protocols_return */,
  1769.     int*        /* count_return */
  1770. #endif
  1771. );
  1772. extern Status XSetWMProtocols(
  1773. #if NeedFunctionPrototypes
  1774.     Display*        /* display */,
  1775.     Window        /* w */,
  1776.     Atom*        /* protocols */,
  1777.     int            /* count */
  1778. #endif
  1779. );
  1780. extern Status XIconifyWindow(
  1781. #if NeedFunctionPrototypes
  1782.     Display*        /* display */,
  1783.     Window        /* w */,
  1784.     int            /* screen_number */
  1785. #endif
  1786. );
  1787. extern Status XWithdrawWindow(
  1788. #if NeedFunctionPrototypes
  1789.     Display*        /* display */,
  1790.     Window        /* w */,
  1791.     int            /* screen_number */
  1792. #endif
  1793. );
  1794. extern Status XGetCommand(
  1795. #if NeedFunctionPrototypes
  1796.     Display*        /* display */,
  1797.     Window        /* w */,
  1798.     char***        /* argv_return */,
  1799.     int*        /* argc_return */
  1800. #endif
  1801. );
  1802. extern Status XGetWMColormapWindows(
  1803. #if NeedFunctionPrototypes
  1804.     Display*        /* display */,
  1805.     Window        /* w */,
  1806.     Window**        /* windows_return */,
  1807.     int*        /* count_return */
  1808. #endif
  1809. );
  1810. extern Status XSetWMColormapWindows(
  1811. #if NeedFunctionPrototypes
  1812.     Display*        /* display */,
  1813.     Window        /* w */,
  1814.     Window*        /* colormap_windows */,
  1815.     int            /* count */
  1816. #endif
  1817. );
  1818. extern void XFreeStringList(
  1819. #if NeedFunctionPrototypes
  1820.     char**        /* list */
  1821. #endif
  1822. );
  1823. extern XSetTransientForHint(
  1824. #if NeedFunctionPrototypes
  1825.     Display*        /* display */,
  1826.     Window        /* w */,
  1827.     Window        /* prop_window */
  1828. #endif
  1829. );
  1830.  
  1831. /* The following are given in alphabetical order */
  1832.  
  1833. extern XActivateScreenSaver(
  1834. #if NeedFunctionPrototypes
  1835.     Display*        /* display */
  1836. #endif
  1837. );
  1838.  
  1839. extern XAddHost(
  1840. #if NeedFunctionPrototypes
  1841.     Display*        /* display */,
  1842.     XHostAddress*    /* host */
  1843. #endif
  1844. );
  1845.  
  1846. extern XAddHosts(
  1847. #if NeedFunctionPrototypes
  1848.     Display*        /* display */,
  1849.     XHostAddress*    /* hosts */,
  1850.     int            /* num_hosts */    
  1851. #endif
  1852. );
  1853.  
  1854. extern XAddToExtensionList(
  1855. #if NeedFunctionPrototypes
  1856.     struct _XExtData**    /* structure */,
  1857.     XExtData*        /* ext_data */
  1858. #endif
  1859. );
  1860.  
  1861. extern XAddToSaveSet(
  1862. #if NeedFunctionPrototypes
  1863.     Display*        /* display */,
  1864.     Window        /* w */
  1865. #endif
  1866. );
  1867.  
  1868. extern Status XAllocColor(
  1869. #if NeedFunctionPrototypes
  1870.     Display*        /* display */,
  1871.     Colormap        /* colormap */,
  1872.     XColor*        /* screen_in_out */
  1873. #endif
  1874. );
  1875.  
  1876. extern Status XAllocColorCells(
  1877. #if NeedFunctionPrototypes
  1878.     Display*        /* display */,
  1879.     Colormap        /* colormap */,
  1880.     Bool            /* contig */,
  1881.     unsigned long*    /* plane_masks_return */,
  1882.     unsigned int    /* nplanes */,
  1883.     unsigned long*    /* pixels_return */,
  1884.     unsigned int     /* npixels */
  1885. #endif
  1886. );
  1887.  
  1888. extern Status XAllocColorPlanes(
  1889. #if NeedFunctionPrototypes
  1890.     Display*        /* display */,
  1891.     Colormap        /* colormap */,
  1892.     Bool        /* contig */,
  1893.     unsigned long*    /* pixels_return */,
  1894.     int            /* ncolors */,
  1895.     int            /* nreds */,
  1896.     int            /* ngreens */,
  1897.     int            /* nblues */,
  1898.     unsigned long*    /* rmask_return */,
  1899.     unsigned long*    /* gmask_return */,
  1900.     unsigned long*    /* bmask_return */
  1901. #endif
  1902. );
  1903.  
  1904. extern Status XAllocNamedColor(
  1905. #if NeedFunctionPrototypes
  1906.     Display*        /* display */,
  1907.     Colormap        /* colormap */,
  1908.     const char*        /* color_name */,
  1909.     XColor*        /* screen_def_return */,
  1910.     XColor*        /* exact_def_return */
  1911. #endif
  1912. );
  1913.  
  1914. extern XAllowEvents(
  1915. #if NeedFunctionPrototypes
  1916.     Display*        /* display */,
  1917.     int            /* event_mode */,
  1918.     Time        /* time */
  1919. #endif
  1920. );
  1921.  
  1922. extern XAutoRepeatOff(
  1923. #if NeedFunctionPrototypes
  1924.     Display*        /* display */
  1925. #endif
  1926. );
  1927.  
  1928. extern XAutoRepeatOn(
  1929. #if NeedFunctionPrototypes
  1930.     Display*        /* display */
  1931. #endif
  1932. );
  1933.  
  1934. extern XBell(
  1935. #if NeedFunctionPrototypes
  1936.     Display*        /* display */,
  1937.     int            /* percent */
  1938. #endif
  1939. );
  1940.  
  1941. extern int XBitmapBitOrder(
  1942. #if NeedFunctionPrototypes
  1943.     Display*        /* display */
  1944. #endif
  1945. );
  1946.  
  1947. extern int XBitmapPad(
  1948. #if NeedFunctionPrototypes
  1949.     Display*        /* display */
  1950. #endif
  1951. );
  1952.  
  1953. extern int XBitmapUnit(
  1954. #if NeedFunctionPrototypes
  1955.     Display*        /* display */
  1956. #endif
  1957. );
  1958.  
  1959. extern int XCellsOfScreen(
  1960. #if NeedFunctionPrototypes
  1961.     Screen*        /* screen */
  1962. #endif
  1963. );
  1964.  
  1965. extern XChangeActivePointerGrab(
  1966. #if NeedFunctionPrototypes
  1967.     Display*        /* display */,
  1968.     unsigned int    /* event_mask */,
  1969.     Cursor        /* cursor */,
  1970.     Time        /* time */
  1971. #endif
  1972. );
  1973.  
  1974. extern XChangeGC(
  1975. #if NeedFunctionPrototypes
  1976.     Display*        /* display */,
  1977.     GC            /* gc */,
  1978.     unsigned long    /* valuemask */,
  1979.     XGCValues*        /* values */
  1980. #endif
  1981. );
  1982.  
  1983. extern XChangeKeyboardControl(
  1984. #if NeedFunctionPrototypes
  1985.     Display*        /* display */,
  1986.     unsigned long    /* value_mask */,
  1987.     XKeyboardControl*    /* values */
  1988. #endif
  1989. );
  1990.  
  1991. extern void XChangeKeyboardMapping(
  1992. #if NeedFunctionPrototypes
  1993.     Display*        /* display */,
  1994.     int            /* first_keycode */,
  1995.     int            /* keysyms_per_keycode */,
  1996.     KeySym*        /* keysyms */,
  1997.     int            /* num_codes */
  1998. #endif
  1999. );
  2000.  
  2001. extern XChangePointerControl(
  2002. #if NeedFunctionPrototypes
  2003.     Display*        /* display */,
  2004.     Bool        /* do_accel */,
  2005.     Bool        /* do_threshold */,
  2006.     int            /* accel_numerator */,
  2007.     int            /* accel_denominator */,
  2008.     int            /* threshold */
  2009. #endif
  2010. );
  2011.  
  2012. extern XChangeProperty(
  2013. #if NeedFunctionPrototypes
  2014.     Display*        /* display */,
  2015.     Window        /* w */,
  2016.     Atom        /* property */,
  2017.     Atom        /* type */,
  2018.     int            /* format */,
  2019.     int            /* mode */,
  2020.     const unsigned char*    /* data */,
  2021.     int            /* nelements */
  2022. #endif
  2023. );
  2024.  
  2025. extern XChangeSaveSet(
  2026. #if NeedFunctionPrototypes
  2027.     Display*        /* display */,
  2028.     Window        /* w */,
  2029.     int            /* change_mode */
  2030. #endif
  2031. );
  2032.  
  2033. extern XChangeWindowAttributes(
  2034. #if NeedFunctionPrototypes
  2035.     Display*        /* display */,
  2036.     Window        /* w */,
  2037.     unsigned long    /* valuemask */,
  2038.     XSetWindowAttributes* /* attributes */
  2039. #endif
  2040. );
  2041.  
  2042. extern Bool XCheckIfEvent(
  2043. #if NeedFunctionPrototypes
  2044.     Display*        /* display */,
  2045.     XEvent*        /* event_return */,
  2046.     Bool (*) ( Display*            /* display */,
  2047.                XEvent*            /* event */,
  2048.                char*            /* arg */
  2049.              )        /* predicate */,
  2050.     char*        /* arg */
  2051. #endif
  2052. );
  2053.  
  2054. extern Bool XCheckMaskEvent(
  2055. #if NeedFunctionPrototypes
  2056.     Display*        /* display */,
  2057.     long        /* event_mask */,
  2058.     XEvent*        /* event_return */
  2059. #endif
  2060. );
  2061.  
  2062. extern Bool XCheckTypedEvent(
  2063. #if NeedFunctionPrototypes
  2064.     Display*        /* display */,
  2065.     int            /* event_type */,
  2066.     XEvent*        /* event_return */
  2067. #endif
  2068. );
  2069.  
  2070. extern Bool XCheckTypedWindowEvent(
  2071. #if NeedFunctionPrototypes
  2072.     Display*        /* display */,
  2073.     Window        /* w */,
  2074.     int            /* event_type */,
  2075.     XEvent*        /* event_return */
  2076. #endif
  2077. );
  2078.  
  2079. extern Bool XCheckWindowEvent(
  2080. #if NeedFunctionPrototypes
  2081.     Display*        /* display */,
  2082.     Window        /* w */,
  2083.     long        /* event_mask */,
  2084.     XEvent*        /* event_return */
  2085. #endif
  2086. );
  2087.  
  2088. extern XCirculateSubwindows(
  2089. #if NeedFunctionPrototypes
  2090.     Display*        /* display */,
  2091.     Window        /* w */,
  2092.     int            /* direction */
  2093. #endif
  2094. );
  2095.  
  2096. extern XCirculateSubwindowsDown(
  2097. #if NeedFunctionPrototypes
  2098.     Display*        /* display */,
  2099.     Window        /* w */
  2100. #endif
  2101. );
  2102.  
  2103. extern XCirculateSubwindowsUp(
  2104. #if NeedFunctionPrototypes
  2105.     Display*        /* display */,
  2106.     Window        /* w */
  2107. #endif
  2108. );
  2109.  
  2110. extern XClearArea(
  2111. #if NeedFunctionPrototypes
  2112.     Display*        /* display */,
  2113.     Window        /* w */,
  2114.     int            /* x */,
  2115.     int            /* y */,
  2116.     unsigned int    /* width */,
  2117.     unsigned int    /* height */,
  2118.     Bool        /* exposures */
  2119. #endif
  2120. );
  2121.  
  2122. extern XClearWindow(
  2123. #if NeedFunctionPrototypes
  2124.     Display*        /* display */,
  2125.     Window        /* w */
  2126. #endif
  2127. );
  2128.  
  2129. extern void XCloseDisplay(
  2130. #if NeedFunctionPrototypes
  2131.     Display*        /* display */
  2132. #endif
  2133. );
  2134.  
  2135. extern XConfigureWindow(
  2136. #if NeedFunctionPrototypes
  2137.     Display*        /* display */,
  2138.     Window        /* w */,
  2139.     unsigned int    /* value_mask */,
  2140.     XWindowChanges*    /* values */         
  2141. #endif
  2142. );
  2143.  
  2144. extern int XConnectionNumber(
  2145. #if NeedFunctionPrototypes
  2146.     Display*        /* display */
  2147. #endif
  2148. );
  2149.  
  2150. extern XConvertSelection(
  2151. #if NeedFunctionPrototypes
  2152.     Display*        /* display */,
  2153.     Atom        /* selection */,
  2154.     Atom         /* target */,
  2155.     Atom        /* property */,
  2156.     Window        /* requestor */,
  2157.     Time        /* time */
  2158. #endif
  2159. );
  2160.  
  2161. extern XCopyArea(
  2162. #if NeedFunctionPrototypes
  2163.     Display*        /* display */,
  2164.     Drawable        /* src */,
  2165.     Drawable        /* dest */,
  2166.     GC            /* gc */,
  2167.     int            /* src_x */,
  2168.     int            /* src_y */,
  2169.     unsigned int    /* width */,
  2170.     unsigned int    /* height */,
  2171.     int            /* dest_x */,
  2172.     int            /* dest_y */
  2173. #endif
  2174. );
  2175.  
  2176. extern XCopyGC(
  2177. #if NeedFunctionPrototypes
  2178.     Display*        /* display */,
  2179.     GC            /* src */,
  2180.     unsigned long    /* valuemask */,
  2181.     GC            /* dest */
  2182. #endif
  2183. );
  2184.  
  2185. extern XCopyPlane(
  2186. #if NeedFunctionPrototypes
  2187.     Display*        /* display */,
  2188.     Drawable        /* src */,
  2189.     Drawable        /* dest */,
  2190.     GC            /* gc */,
  2191.     int            /* src_x */,
  2192.     int            /* src_y */,
  2193.     unsigned int    /* width */,
  2194.     unsigned int    /* height */,
  2195.     int            /* dest_x */,
  2196.     int            /* dest_y */,
  2197.     unsigned long    /* plane */
  2198. #endif
  2199. );
  2200.  
  2201. extern int XDefaultDepth(
  2202. #if NeedFunctionPrototypes
  2203.     Display*        /* display */,
  2204.     int            /* screen_number */
  2205. #endif
  2206. );
  2207.  
  2208. extern int XDefaultDepthOfScreen(
  2209. #if NeedFunctionPrototypes
  2210.     Screen*        /* screen */
  2211. #endif
  2212. );
  2213.  
  2214. extern int XDefaultScreen(
  2215. #if NeedFunctionPrototypes
  2216.     Display*        /* display */
  2217. #endif
  2218. );
  2219.  
  2220. extern XDefineCursor(
  2221. #if NeedFunctionPrototypes
  2222.     Display*        /* display */,
  2223.     Window        /* w */,
  2224.     Cursor        /* cursor */
  2225. #endif
  2226. );
  2227.  
  2228. extern XDeleteProperty(
  2229. #if NeedFunctionPrototypes
  2230.     Display*        /* display */,
  2231.     Window        /* w */,
  2232.     Atom        /* property */
  2233. #endif
  2234. );
  2235.  
  2236. extern XDestroyWindow(
  2237. #if NeedFunctionPrototypes
  2238.     Display*        /* display */,
  2239.     Window        /* w */
  2240. #endif
  2241. );
  2242.  
  2243. extern XDestroySubwindows(
  2244. #if NeedFunctionPrototypes
  2245.     Display*        /* display */,
  2246.     Window        /* w */
  2247. #endif
  2248. );
  2249.  
  2250. extern int XDoesBackingStore(
  2251. #if NeedFunctionPrototypes
  2252.     Screen*        /* screen */    
  2253. #endif
  2254. );
  2255.  
  2256. extern Bool XDoesSaveUnders(
  2257. #if NeedFunctionPrototypes
  2258.     Screen*        /* screen */
  2259. #endif
  2260. );
  2261.  
  2262. extern XDisableAccessControl(
  2263. #if NeedFunctionPrototypes
  2264.     Display*        /* display */
  2265. #endif
  2266. );
  2267.  
  2268.  
  2269. extern int XDisplayCells(
  2270. #if NeedFunctionPrototypes
  2271.     Display*        /* display */,
  2272.     int            /* screen_number */
  2273. #endif
  2274. );
  2275.  
  2276. extern int XDisplayHeight(
  2277. #if NeedFunctionPrototypes
  2278.     Display*        /* display */,
  2279.     int            /* screen_number */
  2280. #endif
  2281. );
  2282.  
  2283. extern int XDisplayHeightMM(
  2284. #if NeedFunctionPrototypes
  2285.     Display*        /* display */,
  2286.     int            /* screen_number */
  2287. #endif
  2288. );
  2289.  
  2290. extern XDisplayKeycodes(
  2291. #if NeedFunctionPrototypes
  2292.     Display*        /* display */,
  2293.     int*        /* min_keycodes_return */,
  2294.     int*        /* max_keycodes_return */
  2295. #endif
  2296. );
  2297.  
  2298. extern int XDisplayPlanes(
  2299. #if NeedFunctionPrototypes
  2300.     Display*        /* display */,
  2301.     int            /* screen_number */
  2302. #endif
  2303. );
  2304.  
  2305. extern int XDisplayWidth(
  2306. #if NeedFunctionPrototypes
  2307.     Display*        /* display */,
  2308.     int            /* screen_number */
  2309. #endif
  2310. );
  2311.  
  2312. extern int XDisplayWidthMM(
  2313. #if NeedFunctionPrototypes
  2314.     Display*        /* display */,
  2315.     int            /* screen_number */
  2316. #endif
  2317. );
  2318.  
  2319. extern XDrawArc(
  2320. #if NeedFunctionPrototypes
  2321.     Display*        /* display */,
  2322.     Drawable        /* d */,
  2323.     GC            /* gc */,
  2324.     int            /* x */,
  2325.     int            /* y */,
  2326.     unsigned int    /* width */,
  2327.     unsigned int    /* height */,
  2328.     int            /* angle1 */,
  2329.     int            /* angle2 */
  2330. #endif
  2331. );
  2332.  
  2333. extern XDrawArcs(
  2334. #if NeedFunctionPrototypes
  2335.     Display*        /* display */,
  2336.     Drawable        /* d */,
  2337.     GC            /* gc */,
  2338.     XArc*        /* arcs */,
  2339.     int            /* narcs */
  2340. #endif
  2341. );
  2342.  
  2343. extern XDrawImageString(
  2344. #if NeedFunctionPrototypes
  2345.     Display*        /* display */,
  2346.     Drawable        /* d */,
  2347.     GC            /* gc */,
  2348.     int            /* x */,
  2349.     int            /* y */,
  2350.     const char*        /* string */,
  2351.     int            /* length */
  2352. #endif
  2353. );
  2354.  
  2355. extern XDrawImageString16(
  2356. #if NeedFunctionPrototypes
  2357.     Display*        /* display */,
  2358.     Drawable        /* d */,
  2359.     GC            /* gc */,
  2360.     int            /* x */,
  2361.     int            /* y */,
  2362.     const XChar2b*    /* string */,
  2363.     int            /* length */
  2364. #endif
  2365. );
  2366.  
  2367. extern XDrawLine(
  2368. #if NeedFunctionPrototypes
  2369.     Display*        /* display */,
  2370.     Drawable        /* d */,
  2371.     GC            /* gc */,
  2372.     int            /* x1 */,
  2373.     int            /* x2 */,
  2374.     int            /* y1 */,
  2375.     int            /* y2 */
  2376. #endif
  2377. );
  2378.  
  2379. extern XDrawLines(
  2380. #if NeedFunctionPrototypes
  2381.     Display*        /* display */,
  2382.     Drawable        /* d */,
  2383.     GC            /* gc */,
  2384.     XPoint*        /* points */,
  2385.     int            /* npoints */,
  2386.     int            /* mode */
  2387. #endif
  2388. );
  2389.  
  2390. extern XDrawPoint(
  2391. #if NeedFunctionPrototypes
  2392.     Display*        /* display */,
  2393.     Drawable        /* d */,
  2394.     GC            /* gc */,
  2395.     int            /* x */,
  2396.     int            /* y */
  2397. #endif
  2398. );
  2399.  
  2400. extern XDrawPoints(
  2401. #if NeedFunctionPrototypes
  2402.     Display*        /* display */,
  2403.     Drawable        /* d */,
  2404.     GC            /* gc */,
  2405.     XPoint*        /* points */,
  2406.     int            /* npoints */,
  2407.     int            /* mode */
  2408. #endif
  2409. );
  2410.  
  2411. extern XDrawRectangle(
  2412. #if NeedFunctionPrototypes
  2413.     Display*        /* display */,
  2414.     Drawable        /* d */,
  2415.     GC            /* gc */,
  2416.     int            /* x */,
  2417.     int            /* y */,
  2418.     unsigned int    /* width */,
  2419.     unsigned int    /* height */
  2420. #endif
  2421. );
  2422.  
  2423. extern XDrawRectangles(
  2424. #if NeedFunctionPrototypes
  2425.     Display*        /* display */,
  2426.     Drawable        /* d */,
  2427.     GC            /* gc */,
  2428.     XRectangle*        /* rectangles */,
  2429.     int            /* nrectangles */
  2430. #endif
  2431. );
  2432.  
  2433. extern XDrawSegments(
  2434. #if NeedFunctionPrototypes
  2435.     Display*        /* display */,
  2436.     Drawable        /* d */,
  2437.     GC            /* gc */,
  2438.     XSegment*        /* segments */,
  2439.     int            /* nsegments */
  2440. #endif
  2441. );
  2442.  
  2443. extern void XDrawString(
  2444. #if NeedFunctionPrototypes
  2445.     Display*        /* display */,
  2446.     Drawable        /* d */,
  2447.     GC            /* gc */,
  2448.     int            /* x */,
  2449.     int            /* y */,
  2450.     const char*        /* string */,
  2451.     int            /* length */
  2452. #endif
  2453. );
  2454.  
  2455. extern void XDrawString16(
  2456. #if NeedFunctionPrototypes
  2457.     Display*        /* display */,
  2458.     Drawable        /* d */,
  2459.     GC            /* gc */,
  2460.     int            /* x */,
  2461.     int            /* y */,
  2462.     const XChar2b*    /* string */,
  2463.     int            /* length */
  2464. #endif
  2465. );
  2466.  
  2467. extern void XDrawText(
  2468. #if NeedFunctionPrototypes
  2469.     Display*        /* display */,
  2470.     Drawable        /* d */,
  2471.     GC            /* gc */,
  2472.     int            /* x */,
  2473.     int            /* y */,
  2474.     XTextItem*        /* items */,
  2475.     int            /* nitems */
  2476. #endif
  2477. );
  2478.  
  2479. extern XDrawText16(
  2480. #if NeedFunctionPrototypes
  2481.     Display*        /* display */,
  2482.     Drawable        /* d */,
  2483.     GC            /* gc */,
  2484.     int            /* x */,
  2485.     int            /* y */,
  2486.     XTextItem16*    /* items */,
  2487.     int            /* nitems */
  2488. #endif
  2489. );
  2490.  
  2491. extern XEnableAccessControl(
  2492. #if NeedFunctionPrototypes
  2493.     Display*        /* display */
  2494. #endif
  2495. );
  2496.  
  2497. extern int XEventsQueued(
  2498. #if NeedFunctionPrototypes
  2499.     Display*        /* display */,
  2500.     int            /* mode */
  2501. #endif
  2502. );
  2503.  
  2504. extern Status XFetchName(
  2505. #if NeedFunctionPrototypes
  2506.     Display*        /* display */,
  2507.     Window        /* w */,
  2508.     char**        /* window_name_return */
  2509. #endif
  2510. );
  2511.  
  2512. extern XFillArc(
  2513. #if NeedFunctionPrototypes
  2514.     Display*        /* display */,
  2515.     Drawable        /* d */,
  2516.     GC            /* gc */,
  2517.     int            /* x */,
  2518.     int            /* y */,
  2519.     unsigned int    /* width */,
  2520.     unsigned int    /* height */,
  2521.     int            /* angle1 */,
  2522.     int            /* angle2 */
  2523. #endif
  2524. );
  2525.  
  2526. extern XFillArcs(
  2527. #if NeedFunctionPrototypes
  2528.     Display*        /* display */,
  2529.     Drawable        /* d */,
  2530.     GC            /* gc */,
  2531.     XArc*        /* arcs */,
  2532.     int            /* narcs */
  2533. #endif
  2534. );
  2535.  
  2536. extern XFillPolygon(
  2537. #if NeedFunctionPrototypes
  2538.     Display*        /* display */,
  2539.     Drawable        /* d */,
  2540.     GC            /* gc */,
  2541.     XPoint*        /* points */,
  2542.     int            /* npoints */,
  2543.     int            /* shape */,
  2544.     int            /* mode */
  2545. #endif
  2546. );
  2547.  
  2548. extern XFillRectangle(
  2549. #if NeedFunctionPrototypes
  2550.     Display*        /* display */,
  2551.     Drawable        /* d */,
  2552.     GC            /* gc */,
  2553.     int            /* x */,
  2554.     int            /* y */,
  2555.     unsigned int    /* width */,
  2556.     unsigned int    /* height */
  2557. #endif
  2558. );
  2559.  
  2560. extern XFillRectangles(
  2561. #if NeedFunctionPrototypes
  2562.     Display*        /* display */,
  2563.     Drawable        /* d */,
  2564.     GC            /* gc */,
  2565.     XRectangle*        /* rectangles */,
  2566.     int            /* nrectangles */
  2567. #endif
  2568. );
  2569.  
  2570. extern XFlush(
  2571. #if NeedFunctionPrototypes
  2572.     Display*        /* display */
  2573. #endif
  2574. );
  2575.  
  2576. extern XForceScreenSaver(
  2577. #if NeedFunctionPrototypes
  2578.     Display*        /* display */,
  2579.     int            /* mode */
  2580. #endif
  2581. );
  2582.  
  2583. extern XFree(
  2584. #if NeedFunctionPrototypes
  2585.     char*        /* data */
  2586. #endif
  2587. );
  2588.  
  2589. extern XFreeColormap(
  2590. #if NeedFunctionPrototypes
  2591.     Display*        /* display */,
  2592.     Colormap        /* colormap */
  2593. #endif
  2594. );
  2595.  
  2596. extern XFreeColors(
  2597. #if NeedFunctionPrototypes
  2598.     Display*        /* display */,
  2599.     Colormap        /* colormap */,
  2600.     unsigned long*    /* pixels */,
  2601.     int            /* npixels */,
  2602.     unsigned long    /* planes */
  2603. #endif
  2604. );
  2605.  
  2606. extern XFreeCursor(
  2607. #if NeedFunctionPrototypes
  2608.     Display*        /* display */,
  2609.     Cursor        /* cursor */
  2610. #endif
  2611. );
  2612.  
  2613. extern XFreeExtensionList(
  2614. #if NeedFunctionPrototypes
  2615.     char**        /* list */    
  2616. #endif
  2617. );
  2618.  
  2619. extern XFreeFont(
  2620. #if NeedFunctionPrototypes
  2621.     Display*        /* display */,
  2622.     XFontStruct*    /* font_struct */
  2623. #endif
  2624. );
  2625.  
  2626. extern XFreeFontInfo(
  2627. #if NeedFunctionPrototypes
  2628.     char**        /* names */,
  2629.     XFontStruct*    /* free_info */,
  2630.     int            /* actual_count */
  2631. #endif
  2632. );
  2633.  
  2634. extern XFreeFontNames(
  2635. #if NeedFunctionPrototypes
  2636.     char**        /* list */
  2637. #endif
  2638. );
  2639.  
  2640. extern XFreeFontPath(
  2641. #if NeedFunctionPrototypes
  2642.     char**        /* list */
  2643. #endif
  2644. );
  2645.  
  2646. extern XFreeGC(
  2647. #if NeedFunctionPrototypes
  2648.     Display*        /* display */,
  2649.     GC            /* gc */
  2650. #endif
  2651. );
  2652.  
  2653. extern XFreeModifiermap(
  2654. #if NeedFunctionPrototypes
  2655.     XModifierKeymap*    /* modmap */
  2656. #endif
  2657. );
  2658.  
  2659. extern XFreePixmap(
  2660. #if NeedFunctionPrototypes
  2661.     Display*        /* display */,
  2662.     Pixmap        /* pixmap */
  2663. #endif
  2664. );
  2665.  
  2666. extern int XGeometry(
  2667. #if NeedFunctionPrototypes
  2668.     Display*        /* display */,
  2669.     int            /* screen */,
  2670.     const char*        /* position */,
  2671.     const char*        /* default_position */,
  2672.     unsigned int    /* bwidth */,
  2673.     unsigned int    /* fwidth */,
  2674.     unsigned int    /* fheight */,
  2675.     int            /* xadder */,
  2676.     int            /* yadder */,
  2677.     int*        /* x_return */,
  2678.     int*        /* y_return */,
  2679.     int*        /* width_return */,
  2680.     int*        /* height_return */
  2681. #endif
  2682. );
  2683.  
  2684. extern void XGetErrorDatabaseText(
  2685. #if NeedFunctionPrototypes
  2686.     Display*        /* display */,
  2687.     const char*        /* name */,
  2688.     const char*        /* message */,
  2689.     const char*        /* default_string */,
  2690.     char*        /* buffer_return */,
  2691.     int            /* length */
  2692. #endif
  2693. );
  2694.  
  2695. extern void XGetErrorText(
  2696. #if NeedFunctionPrototypes
  2697.     Display*        /* display */,
  2698.     int            /* code */,
  2699.     char*        /* buffer_return */,
  2700.     int            /* length */
  2701. #endif
  2702. );
  2703.  
  2704. extern Bool XGetFontProperty(
  2705. #if NeedFunctionPrototypes
  2706.     XFontStruct*    /* font_struct */,
  2707.     Atom        /* atom */,
  2708.     unsigned long*    /* value_return */
  2709. #endif
  2710. );
  2711.  
  2712. extern Status XGetGCValues(
  2713. #if NeedFunctionPrototypes
  2714.     Display*        /* display */,
  2715.     GC            /* gc */,
  2716.     unsigned long    /* valuemask */,
  2717.     XGCValues*        /* values_return */
  2718. #endif
  2719. );
  2720.  
  2721. extern Status XGetGeometry(
  2722. #if NeedFunctionPrototypes
  2723.     Display*        /* display */,
  2724.     Drawable        /* d */,
  2725.     Window*        /* root_return */,
  2726.     int*        /* x_return */,
  2727.     int*        /* y_return */,
  2728.     unsigned int*    /* width_return */,
  2729.     unsigned int*    /* height_return */,
  2730.     unsigned int*    /* border_width_return */,
  2731.     unsigned int*    /* depth_return */
  2732. #endif
  2733. );
  2734.  
  2735. extern Status XGetIconName(
  2736. #if NeedFunctionPrototypes
  2737.     Display*        /* display */,
  2738.     Window        /* w */,
  2739.     char**        /* icon_name_return */
  2740. #endif
  2741. );
  2742.  
  2743. extern XGetInputFocus(
  2744. #if NeedFunctionPrototypes
  2745.     Display*        /* display */,
  2746.     Window*        /* focus_return */,
  2747.     int*        /* revert_to_return */
  2748. #endif
  2749. );
  2750.  
  2751. extern XGetKeyboardControl(
  2752. #if NeedFunctionPrototypes
  2753.     Display*        /* display */,
  2754.     XKeyboardState*    /* values_return */
  2755. #endif
  2756. );
  2757.  
  2758. extern XGetPointerControl(
  2759. #if NeedFunctionPrototypes
  2760.     Display*        /* display */,
  2761.     int*        /* accel_numerator_return */,
  2762.     int*        /* accel_denominator_return */,
  2763.     int*        /* threshold_return */
  2764. #endif
  2765. );
  2766.  
  2767. extern int XGetPointerMapping(
  2768. #if NeedFunctionPrototypes
  2769.     Display*        /* display */,
  2770.     unsigned char*    /* map_return */,
  2771.     int            /* nmap */
  2772. #endif
  2773. );
  2774.  
  2775. extern XGetScreenSaver(
  2776. #if NeedFunctionPrototypes
  2777.     Display*        /* display */,
  2778.     int*        /* timeout_return */,
  2779.     int*        /* interval_return */,
  2780.     int*        /* prefer_blanking_return */,
  2781.     int*        /* allow_exposures_return */
  2782. #endif
  2783. );
  2784.  
  2785. extern Status XGetTransientForHint(
  2786. #if NeedFunctionPrototypes
  2787.     Display*        /* display */,
  2788.     Window        /* w */,
  2789.     Window*        /* prop_window_return */
  2790. #endif
  2791. );
  2792.  
  2793. extern int XGetWindowProperty(
  2794. #if NeedFunctionPrototypes
  2795.     Display*        /* display */,
  2796.     Window        /* w */,
  2797.     Atom        /* property */,
  2798.     long        /* long_offset */,
  2799.     long        /* long_length */,
  2800.     Bool        /* delete */,
  2801.     Atom        /* req_type */,
  2802.     Atom*        /* actual_type_return */,
  2803.     int*        /* actual_format_return */,
  2804.     unsigned long*    /* nitems_return */,
  2805.     unsigned long*    /* bytes_after_return */,
  2806.     unsigned char**    /* prop_return */
  2807. #endif
  2808. );
  2809.  
  2810. extern Status XGetWindowAttributes(
  2811. #if NeedFunctionPrototypes
  2812.     Display*        /* display */,
  2813.     Window        /* w */,
  2814.     XWindowAttributes*    /* window_attributes_return */
  2815. #endif
  2816. );
  2817.  
  2818. extern XGrabButton(
  2819. #if NeedFunctionPrototypes
  2820.     Display*        /* display */,
  2821.     unsigned int    /* button */,
  2822.     unsigned int    /* modifiers */,
  2823.     Window        /* grab_window */,
  2824.     Bool        /* owner_events */,
  2825.     unsigned int    /* event_mask */,
  2826.     int            /* pointer_mode */,
  2827.     int            /* keyboard_mode */,
  2828.     Window        /* confine_to */,
  2829.     Cursor        /* cursor */
  2830. #endif
  2831. );
  2832.  
  2833. extern XGrabKey(
  2834. #if NeedFunctionPrototypes
  2835.     Display*        /* display */,
  2836.     int            /* keycode */,
  2837.     unsigned int    /* modifiers */,
  2838.     Window        /* grab_window */,
  2839.     Bool        /* owner_events */,
  2840.     int            /* pointer_mode */,
  2841.     int            /* keyboard_mode */
  2842. #endif
  2843. );
  2844.  
  2845. extern int XGrabKeyboard(
  2846. #if NeedFunctionPrototypes
  2847.     Display*        /* display */,
  2848.     Window        /* grab_window */,
  2849.     Bool        /* owner_events */,
  2850.     int            /* pointer_mode */,
  2851.     int            /* keyboard_mode */,
  2852.     Time        /* time */
  2853. #endif
  2854. );
  2855.  
  2856. extern int XGrabPointer(
  2857. #if NeedFunctionPrototypes
  2858.     Display*        /* display */,
  2859.     Window        /* grab_window */,
  2860.     Bool        /* owner_events */,
  2861.     unsigned int    /* event_mask */,
  2862.     int            /* pointer_mode */,
  2863.     int            /* keyboard_mode */,
  2864.     Window        /* confine_to */,
  2865.     Cursor        /* cursor */,
  2866.     Time        /* time */
  2867. #endif
  2868. );
  2869.  
  2870. extern XGrabServer(
  2871. #if NeedFunctionPrototypes
  2872.     Display*        /* display */
  2873. #endif
  2874. );
  2875.  
  2876. extern int XHeightMMOfScreen(
  2877. #if NeedFunctionPrototypes
  2878.     Screen*        /* screen */
  2879. #endif
  2880. );
  2881.  
  2882. extern int XHeightOfScreen(
  2883. #if NeedFunctionPrototypes
  2884.     Screen*        /* screen */
  2885. #endif
  2886. );
  2887.  
  2888. extern void XIfEvent(
  2889. #if NeedFunctionPrototypes
  2890.     Display*        /* display */,
  2891.     XEvent*        /* event_return */,
  2892.     Bool (*) ( Display*            /* display */,
  2893.                XEvent*            /* event */,
  2894.                char*            /* arg */
  2895.              )        /* predicate */,
  2896.     char*        /* arg */
  2897. #endif
  2898. );
  2899.  
  2900. extern int XImageByteOrder(
  2901. #if NeedFunctionPrototypes
  2902.     Display*        /* display */
  2903. #endif
  2904. );
  2905.  
  2906. extern XInstallColormap(
  2907. #if NeedFunctionPrototypes
  2908.     Display*        /* display */,
  2909.     Colormap        /* colormap */
  2910. #endif
  2911. );
  2912.  
  2913. extern KeyCode XKeysymToKeycode(
  2914. #if NeedFunctionPrototypes
  2915.     Display*        /* display */,
  2916.     KeySym        /* keysym */
  2917. #endif
  2918. );
  2919.  
  2920. extern XKillClient(
  2921. #if NeedFunctionPrototypes
  2922.     Display*        /* display */,
  2923.     XID            /* resource */
  2924. #endif
  2925. );
  2926.  
  2927. extern unsigned long XLastKnownRequestProcessed(
  2928. #if NeedFunctionPrototypes
  2929.     Display*        /* display */
  2930. #endif
  2931. );
  2932.  
  2933. extern Status XLookupColor(
  2934. #if NeedFunctionPrototypes
  2935.     Display*        /* display */,
  2936.     Colormap        /* colormap */,
  2937.     const char*        /* color_name */,
  2938.     XColor*        /* exact_def_return */,
  2939.     XColor*        /* screen_def_return */
  2940. #endif
  2941. );
  2942.  
  2943. extern XLowerWindow(
  2944. #if NeedFunctionPrototypes
  2945.     Display*        /* display */,
  2946.     Window        /* w */
  2947. #endif
  2948. );
  2949.  
  2950. extern XMapRaised(
  2951. #if NeedFunctionPrototypes
  2952.     Display*        /* display */,
  2953.     Window        /* w */
  2954. #endif
  2955. );
  2956.  
  2957. extern XMapSubwindows(
  2958. #if NeedFunctionPrototypes
  2959.     Display*        /* display */,
  2960.     Window        /* w */
  2961. #endif
  2962. );
  2963.  
  2964. extern XMapWindow(
  2965. #if NeedFunctionPrototypes
  2966.     Display*        /* display */,
  2967.     Window        /* w */
  2968. #endif
  2969. );
  2970.  
  2971. extern void XMaskEvent(
  2972. #if NeedFunctionPrototypes
  2973.     Display*        /* display */,
  2974.     long        /* event_mask */,
  2975.     XEvent*        /* event_return */
  2976. #endif
  2977. );
  2978.  
  2979. extern int XMaxCmapsOfScreen(
  2980. #if NeedFunctionPrototypes
  2981.     Screen*        /* screen */
  2982. #endif
  2983. );
  2984.  
  2985. extern int XMinCmapsOfScreen(
  2986. #if NeedFunctionPrototypes
  2987.     Screen*        /* screen */
  2988. #endif
  2989. );
  2990.  
  2991. extern XMoveResizeWindow(
  2992. #if NeedFunctionPrototypes
  2993.     Display*        /* display */,
  2994.     Window        /* w */,
  2995.     int            /* x */,
  2996.     int            /* y */,
  2997.     unsigned int    /* width */,
  2998.     unsigned int    /* height */
  2999. #endif
  3000. );
  3001.  
  3002. extern XMoveWindow(
  3003. #if NeedFunctionPrototypes
  3004.     Display*        /* display */,
  3005.     Window        /* w */,
  3006.     int            /* x */,
  3007.     int            /* y */
  3008. #endif
  3009. );
  3010.  
  3011. extern void XNextEvent(
  3012. #if NeedFunctionPrototypes
  3013.     Display*        /* display */,
  3014.     XEvent*        /* event_return */
  3015. #endif
  3016. );
  3017.  
  3018. extern XNoOp(
  3019. #if NeedFunctionPrototypes
  3020.     Display*        /* display */
  3021. #endif
  3022. );
  3023.  
  3024. extern Status XParseColor(
  3025. #if NeedFunctionPrototypes
  3026.     Display*        /* display */,
  3027.     Colormap        /* colormap */,
  3028.     const char*        /* spec */,
  3029.     XColor*        /* exact_def_return */
  3030. #endif
  3031. );
  3032.  
  3033. extern int XParseGeometry(
  3034. #if NeedFunctionPrototypes
  3035.     const char*        /* parsestring */,
  3036.     int*        /* x_return */,
  3037.     int*        /* y_return */,
  3038.     unsigned int*    /* width_return */,
  3039.     unsigned int*    /* height_return */
  3040. #endif
  3041. );
  3042.  
  3043. extern XPeekEvent(
  3044. #if NeedFunctionPrototypes
  3045.     Display*        /* display */,
  3046.     XEvent*        /* event_return */
  3047. #endif
  3048. );
  3049.  
  3050. extern void XPeekIfEvent(
  3051. #if NeedFunctionPrototypes
  3052.     Display*        /* display */,
  3053.     XEvent*        /* event_return */,
  3054.     Bool (*) ( Display*        /* display */,
  3055.                XEvent*        /* event */,
  3056.                char*        /* arg */
  3057.              )        /* predicate */,
  3058.     char*        /* arg */
  3059. #endif
  3060. );
  3061.  
  3062. extern int XPending(
  3063. #if NeedFunctionPrototypes
  3064.     Display*        /* display */
  3065. #endif
  3066. );
  3067.  
  3068. extern int XPlanesOfScreen(
  3069. #if NeedFunctionPrototypes
  3070.     Screen*        /* screen */
  3071.     
  3072. #endif
  3073. );
  3074.  
  3075. extern int XProtocolRevision(
  3076. #if NeedFunctionPrototypes
  3077.     Display*        /* display */
  3078. #endif
  3079. );
  3080.  
  3081. extern int XProtocolVersion(
  3082. #if NeedFunctionPrototypes
  3083.     Display*        /* display */
  3084. #endif
  3085. );
  3086.  
  3087.  
  3088. extern void XPutBackEvent(
  3089. #if NeedFunctionPrototypes
  3090.     Display*        /* display */,
  3091.     XEvent*        /* event */
  3092. #endif
  3093. );
  3094.  
  3095. extern void XPutImage(
  3096. #if NeedFunctionPrototypes
  3097.     Display*        /* display */,
  3098.     Drawable        /* d */,
  3099.     GC            /* gc */,
  3100.     XImage*        /* image */,
  3101.     int            /* src_x */,
  3102.     int            /* src_y */,
  3103.     int            /* dest_x */,
  3104.     int            /* dest_y */,
  3105.     unsigned int    /* width */,
  3106.     unsigned int    /* height */      
  3107. #endif
  3108. );
  3109.  
  3110. extern int XQLength(
  3111. #if NeedFunctionPrototypes
  3112.     Display*        /* display */
  3113. #endif
  3114. );
  3115.  
  3116. extern Status XQueryBestCursor(
  3117. #if NeedFunctionPrototypes
  3118.     Display*        /* display */,
  3119.     Drawable        /* d */,
  3120.     unsigned int        /* width */,
  3121.     unsigned int    /* height */,
  3122.     unsigned int*    /* width_return */,
  3123.     unsigned int*    /* height_return */
  3124. #endif
  3125. );
  3126.  
  3127. extern Status XQueryBestSize(
  3128. #if NeedFunctionPrototypes
  3129.     Display*        /* display */,
  3130.     int            /* class */,
  3131.     Drawable        /* which_screen */,
  3132.     unsigned int    /* width */,
  3133.     unsigned int    /* height */,
  3134.     unsigned int*    /* width_return */,
  3135.     unsigned int*    /* height_return */
  3136. #endif
  3137. );
  3138.  
  3139. extern Status XQueryBestStipple(
  3140. #if NeedFunctionPrototypes
  3141.     Display*        /* display */,
  3142.     Drawable        /* which_screen */,
  3143.     unsigned int    /* width */,
  3144.     unsigned int    /* height */,
  3145.     unsigned int*    /* width_return */,
  3146.     unsigned int*    /* height_return */
  3147. #endif
  3148. );
  3149.  
  3150. extern Status XQueryBestTile(
  3151. #if NeedFunctionPrototypes
  3152.     Display*        /* display */,
  3153.     Drawable        /* which_screen */,
  3154.     unsigned int    /* width */,
  3155.     unsigned int    /* height */,
  3156.     unsigned int*    /* width_return */,
  3157.     unsigned int*    /* height_return */
  3158. #endif
  3159. );
  3160.  
  3161. extern XQueryColor(
  3162. #if NeedFunctionPrototypes
  3163.     Display*        /* display */,
  3164.     Colormap        /* colormap */,
  3165.     XColor*        /* def_in_out */
  3166. #endif
  3167. );
  3168.  
  3169. extern XQueryColors(
  3170. #if NeedFunctionPrototypes
  3171.     Display*        /* display */,
  3172.     Colormap        /* colormap */,
  3173.     XColor*        /* defs_in_out */,
  3174.     int            /* ncolors */
  3175. #endif
  3176. );
  3177.  
  3178. extern Bool XQueryExtension(
  3179. #if NeedFunctionPrototypes
  3180.     Display*        /* display */,
  3181.     const char*        /* name */,
  3182.     int*        /* major_opcode_return */,
  3183.     int*        /* first_event_return */,
  3184.     int*        /* first_error_return */
  3185. #endif
  3186. );
  3187.  
  3188. extern XQueryKeymap(
  3189. #if NeedFunctionPrototypes
  3190.     Display*        /* display */,
  3191.     char [32]        /* keys_return */
  3192. #endif
  3193. );
  3194.  
  3195. extern Bool XQueryPointer(
  3196. #if NeedFunctionPrototypes
  3197.     Display*        /* display */,
  3198.     Window        /* w */,
  3199.     Window*        /* root_return */,
  3200.     Window*        /* child_return */,
  3201.     int*        /* root_x_return */,
  3202.     int*        /* root_y_return */,
  3203.     int*        /* win_x_return */,
  3204.     int*        /* win_y_return */,
  3205.     unsigned int*       /* mask_return */
  3206. #endif
  3207. );
  3208.  
  3209. extern XQueryTextExtents(
  3210. #if NeedFunctionPrototypes
  3211.     Display*        /* display */,
  3212.     XID            /* font_ID */,
  3213.     const char*        /* string */,
  3214.     int            /* nchars */,
  3215.     int*        /* direction_return */,
  3216.     int*        /* font_ascent_return */,
  3217.     int*        /* font_descent_return */,
  3218.     XCharStruct*    /* overall_return */    
  3219. #endif
  3220. );
  3221.  
  3222. extern XQueryTextExtents16(
  3223. #if NeedFunctionPrototypes
  3224.     Display*        /* display */,
  3225.     XID            /* font_ID */,
  3226.     const XChar2b*    /* string */,
  3227.     int            /* nchars */,
  3228.     int*        /* direction_return */,
  3229.     int*        /* font_ascent_return */,
  3230.     int*        /* font_descent_return */,
  3231.     XCharStruct*    /* overall_return */
  3232. #endif
  3233. );
  3234.  
  3235. extern Status XQueryTree(
  3236. #if NeedFunctionPrototypes
  3237.     Display*        /* display */,
  3238.     Window        /* w */,
  3239.     Window*        /* root_return */,
  3240.     Window*        /* parent_return */,
  3241.     Window**        /* children_return */,
  3242.     unsigned int*    /* nchildren_return */
  3243. #endif
  3244. );
  3245.  
  3246. extern XRaiseWindow(
  3247. #if NeedFunctionPrototypes
  3248.     Display*        /* display */,
  3249.     Window        /* w */
  3250. #endif
  3251. );
  3252.  
  3253. extern int XReadBitmapFile(
  3254. #if NeedFunctionPrototypes
  3255.     Display*        /* display */,
  3256.     Drawable         /* d */,
  3257.     const char*        /* filename */,
  3258.     unsigned int*    /* width_return */,
  3259.     unsigned int*    /* height_return */,
  3260.     Pixmap*        /* bitmap_return */,
  3261.     int*        /* x_hot_return */,
  3262.     int*        /* y_hot_return */
  3263. #endif
  3264. );
  3265.  
  3266. extern void XRebindKeysym(
  3267. #if NeedFunctionPrototypes
  3268.     Display*        /* display */,
  3269.     KeySym        /* keysym */,
  3270.     KeySym*        /* list */,
  3271.     int            /* mod_count */,
  3272.     const unsigned char*    /* string */,
  3273.     int            /* bytes_string */
  3274. #endif
  3275. );
  3276.  
  3277. extern XRecolorCursor(
  3278. #if NeedFunctionPrototypes
  3279.     Display*        /* display */,
  3280.     Cursor        /* cursor */,
  3281.     XColor*        /* foreground_color */,
  3282.     XColor*        /* background_color */
  3283. #endif
  3284. );
  3285.  
  3286. extern XRefreshKeyboardMapping(
  3287. #if NeedFunctionPrototypes
  3288.     XMappingEvent*    /* event_map */    
  3289. #endif
  3290. );
  3291.  
  3292. extern XRemoveFromSaveSet(
  3293. #if NeedFunctionPrototypes
  3294.     Display*        /* display */,
  3295.     Window        /* w */
  3296. #endif
  3297. );
  3298.  
  3299. extern XRemoveHost(
  3300. #if NeedFunctionPrototypes
  3301.     Display*        /* display */,
  3302.     XHostAddress*    /* host */
  3303. #endif
  3304. );
  3305.  
  3306. extern XRemoveHosts(
  3307. #if NeedFunctionPrototypes
  3308.     Display*        /* display */,
  3309.     XHostAddress*    /* hosts */,
  3310.     int            /* num_hosts */
  3311. #endif
  3312. );
  3313.  
  3314. extern XReparentWindow(
  3315. #if NeedFunctionPrototypes
  3316.     Display*        /* display */,
  3317.     Window        /* w */,
  3318.     Window        /* parent */,
  3319.     int            /* x */,
  3320.     int            /* y */
  3321. #endif
  3322. );
  3323.  
  3324. extern XResetScreenSaver(
  3325. #if NeedFunctionPrototypes
  3326.     Display*        /* display */
  3327. #endif
  3328. );
  3329.  
  3330. extern XResizeWindow(
  3331. #if NeedFunctionPrototypes
  3332.     Display*        /* display */,
  3333.     Window        /* w */,
  3334.     unsigned int    /* width */,
  3335.     unsigned int    /* height */
  3336. #endif
  3337. );
  3338.  
  3339. extern XRestackWindows(
  3340. #if NeedFunctionPrototypes
  3341.     Display*        /* display */,
  3342.     Window*        /* windows */,
  3343.     int            /* nwindows */
  3344. #endif
  3345. );
  3346.  
  3347. extern XRotateBuffers(
  3348. #if NeedFunctionPrototypes
  3349.     Display*        /* display */,
  3350.     int            /* rotate */
  3351. #endif
  3352. );
  3353.  
  3354. extern XRotateWindowProperties(
  3355. #if NeedFunctionPrototypes
  3356.     Display*        /* display */,
  3357.     Window        /* w */,
  3358.     Atom*        /* properties */,
  3359.     int            /* num_prop */,
  3360.     int            /* npositions */
  3361. #endif
  3362. );
  3363.  
  3364. extern int XScreenCount(
  3365. #if NeedFunctionPrototypes
  3366.     Display*        /* display */
  3367. #endif
  3368. );
  3369.  
  3370. extern XSelectInput(
  3371. #if NeedFunctionPrototypes
  3372.     Display*        /* display */,
  3373.     Window        /* w */,
  3374.     long        /* event_mask */
  3375. #endif
  3376. );
  3377.  
  3378. extern Status XSendEvent(
  3379. #if NeedFunctionPrototypes
  3380.     Display*        /* display */,
  3381.     Window        /* w */,
  3382.     Bool        /* propagate */,
  3383.     long        /* event_mask */,
  3384.     XEvent*        /* event_send */
  3385. #endif
  3386. );
  3387.  
  3388. extern XSetAccessControl(
  3389. #if NeedFunctionPrototypes
  3390.     Display*        /* display */,
  3391.     int            /* mode */
  3392. #endif
  3393. );
  3394.  
  3395. extern XSetArcMode(
  3396. #if NeedFunctionPrototypes
  3397.     Display*        /* display */,
  3398.     GC            /* gc */,
  3399.     int            /* arc_mode */
  3400. #endif
  3401. );
  3402.  
  3403. extern XSetBackground(
  3404. #if NeedFunctionPrototypes
  3405.     Display*        /* display */,
  3406.     GC            /* gc */,
  3407.     unsigned long    /* background */
  3408. #endif
  3409. );
  3410.  
  3411. extern XSetClipMask(
  3412. #if NeedFunctionPrototypes
  3413.     Display*        /* display */,
  3414.     GC            /* gc */,
  3415.     Pixmap        /* pixmap */
  3416. #endif
  3417. );
  3418.  
  3419. extern XSetClipOrigin(
  3420. #if NeedFunctionPrototypes
  3421.     Display*        /* display */,
  3422.     GC            /* gc */,
  3423.     int            /* clip_x_origin */,
  3424.     int            /* clip_y_origin */
  3425. #endif
  3426. );
  3427.  
  3428. extern XSetClipRectangles(
  3429. #if NeedFunctionPrototypes
  3430.     Display*        /* display */,
  3431.     GC            /* gc */,
  3432.     int            /* clip_x_origin */,
  3433.     int            /* clip_y_origin */,
  3434.     XRectangle*        /* rectangles */,
  3435.     int            /* n */,
  3436.     int            /* ordering */
  3437. #endif
  3438. );
  3439.  
  3440. extern XSetCloseDownMode(
  3441. #if NeedFunctionPrototypes
  3442.     Display*        /* display */,
  3443.     int            /* close_mode */
  3444. #endif
  3445. );
  3446.  
  3447. extern XSetCommand(
  3448. #if NeedFunctionPrototypes
  3449.     Display*        /* display */,
  3450.     Window        /* w */,
  3451.     char**        /* argv */,
  3452.     int            /* argc */
  3453. #endif
  3454. );
  3455.  
  3456. extern XSetDashes(
  3457. #if NeedFunctionPrototypes
  3458.     Display*        /* display */,
  3459.     GC            /* gc */,
  3460.     int            /* dash_offset */,
  3461.     const char*        /* dash_list */,
  3462.     int            /* n */
  3463. #endif
  3464. );
  3465.  
  3466. extern XSetFillRule(
  3467. #if NeedFunctionPrototypes
  3468.     Display*        /* display */,
  3469.     GC            /* gc */,
  3470.     int            /* fill_rule */
  3471. #endif
  3472. );
  3473.  
  3474. extern XSetFillStyle(
  3475. #if NeedFunctionPrototypes
  3476.     Display*        /* display */,
  3477.     GC            /* gc */,
  3478.     int            /* fill_style */
  3479. #endif
  3480. );
  3481.  
  3482. extern XSetFont(
  3483. #if NeedFunctionPrototypes
  3484.     Display*        /* display */,
  3485.     GC            /* gc */,
  3486.     Font        /* font */
  3487. #endif
  3488. );
  3489.  
  3490. extern XSetFontPath(
  3491. #if NeedFunctionPrototypes
  3492.     Display*        /* display */,
  3493.     char**        /* directories */,
  3494.     int            /* ndirs */         
  3495. #endif
  3496. );
  3497.  
  3498. extern XSetForeground(
  3499. #if NeedFunctionPrototypes
  3500.     Display*        /* display */,
  3501.     GC            /* gc */,
  3502.     unsigned long    /* foreground */
  3503. #endif
  3504. );
  3505.  
  3506. extern XSetFunction(
  3507. #if NeedFunctionPrototypes
  3508.     Display*        /* display */,
  3509.     GC            /* gc */,
  3510.     int            /* function */
  3511. #endif
  3512. );
  3513.  
  3514. extern XSetGraphicsExposures(
  3515. #if NeedFunctionPrototypes
  3516.     Display*        /* display */,
  3517.     GC            /* gc */,
  3518.     Bool        /* graphics_exposures */
  3519. #endif
  3520. );
  3521.  
  3522. extern XSetIconName(
  3523. #if NeedFunctionPrototypes
  3524.     Display*        /* display */,
  3525.     Window        /* w */,
  3526.     const char*        /* icon_name */
  3527. #endif
  3528. );
  3529.  
  3530. extern XSetInputFocus(
  3531. #if NeedFunctionPrototypes
  3532.     Display*        /* display */,
  3533.     Window        /* focus */,
  3534.     int            /* revert_to */,
  3535.     Time        /* time */
  3536. #endif
  3537. );
  3538.  
  3539. extern XSetLineAttributes(
  3540. #if NeedFunctionPrototypes
  3541.     Display*        /* display */,
  3542.     GC            /* gc */,
  3543.     unsigned int    /* line_width */,
  3544.     int            /* line_style */,
  3545.     int            /* cap_style */,
  3546.     int            /* join_style */
  3547. #endif
  3548. );
  3549.  
  3550. extern int XSetModifierMapping(
  3551. #if NeedFunctionPrototypes
  3552.     Display*        /* display */,
  3553.     XModifierKeymap*    /* modmap */
  3554. #endif
  3555. );
  3556.  
  3557. extern XSetPlaneMask(
  3558. #if NeedFunctionPrototypes
  3559.     Display*        /* display */,
  3560.     GC            /* gc */,
  3561.     unsigned long    /* plane_mask */
  3562. #endif
  3563. );
  3564.  
  3565. extern int XSetPointerMapping(
  3566. #if NeedFunctionPrototypes
  3567.     Display*        /* display */,
  3568.     const unsigned char*    /* map */,
  3569.     int            /* nmap */
  3570. #endif
  3571. );
  3572.  
  3573. extern XSetScreenSaver(
  3574. #if NeedFunctionPrototypes
  3575.     Display*        /* display */,
  3576.     int            /* timeout */,
  3577.     int            /* interval */,
  3578.     int            /* prefer_blanking */,
  3579.     int            /* allow_exposures */
  3580. #endif
  3581. );
  3582.  
  3583. extern XSetSelectionOwner(
  3584. #if NeedFunctionPrototypes
  3585.     Display*        /* display */,
  3586.     Atom            /* selection */,
  3587.     Window        /* owner */,
  3588.     Time        /* time */
  3589. #endif
  3590. );
  3591.  
  3592. extern XSetState(
  3593. #if NeedFunctionPrototypes
  3594.     Display*        /* display */,
  3595.     GC            /* gc */,
  3596.     unsigned long     /* foreground */,
  3597.     unsigned long    /* background */,
  3598.     int            /* function */,
  3599.     unsigned long    /* plane_mask */
  3600. #endif
  3601. );
  3602.  
  3603. extern XSetStipple(
  3604. #if NeedFunctionPrototypes
  3605.     Display*        /* display */,
  3606.     GC            /* gc */,
  3607.     Pixmap        /* stipple */
  3608. #endif
  3609. );
  3610.  
  3611. extern XSetSubwindowMode(
  3612. #if NeedFunctionPrototypes
  3613.     Display*        /* display */,
  3614.     GC            /* gc */,
  3615.     int            /* subwindow_mode */
  3616. #endif
  3617. );
  3618.  
  3619. extern XSetTSOrigin(
  3620. #if NeedFunctionPrototypes
  3621.     Display*        /* display */,
  3622.     GC            /* gc */,
  3623.     int            /* ts_x_origin */,
  3624.     int            /* ts_y_origin */
  3625. #endif
  3626. );
  3627.  
  3628. extern XSetTile(
  3629. #if NeedFunctionPrototypes
  3630.     Display*        /* display */,
  3631.     GC            /* gc */,
  3632.     Pixmap        /* tile */
  3633. #endif
  3634. );
  3635.  
  3636. extern XSetWindowBackground(
  3637. #if NeedFunctionPrototypes
  3638.     Display*        /* display */,
  3639.     Window        /* w */,
  3640.     unsigned long    /* background_pixel */
  3641. #endif
  3642. );
  3643.  
  3644. extern XSetWindowBackgroundPixmap(
  3645. #if NeedFunctionPrototypes
  3646.     Display*        /* display */,
  3647.     Window        /* w */,
  3648.     Pixmap        /* background_pixmap */
  3649. #endif
  3650. );
  3651.  
  3652. extern XSetWindowBorder(
  3653. #if NeedFunctionPrototypes
  3654.     Display*        /* display */,
  3655.     Window        /* w */,
  3656.     unsigned long    /* border_pixel */
  3657. #endif
  3658. );
  3659.  
  3660. extern XSetWindowBorderPixmap(
  3661. #if NeedFunctionPrototypes
  3662.     Display*        /* display */,
  3663.     Window        /* w */,
  3664.     Pixmap        /* border_pixmap */
  3665. #endif
  3666. );
  3667.  
  3668. extern XSetWindowBorderWidth(
  3669. #if NeedFunctionPrototypes
  3670.     Display*        /* display */,
  3671.     Window        /* w */,
  3672.     unsigned int    /* width */
  3673. #endif
  3674. );
  3675.  
  3676. extern XSetWindowColormap(
  3677. #if NeedFunctionPrototypes
  3678.     Display*        /* display */,
  3679.     Window        /* w */,
  3680.     Colormap        /* colormap */
  3681. #endif
  3682. );
  3683.  
  3684. extern void XStoreBuffer(
  3685. #if NeedFunctionPrototypes
  3686.     Display*        /* display */,
  3687.     const char*        /* bytes */,
  3688.     int            /* nbytes */,
  3689.     int            /* buffer */
  3690. #endif
  3691. );
  3692.  
  3693. extern XStoreBytes(
  3694. #if NeedFunctionPrototypes
  3695.     Display*        /* display */,
  3696.     const char*        /* bytes */,
  3697.     int            /* nbytes */
  3698. #endif
  3699. );
  3700.  
  3701. extern XStoreColor(
  3702. #if NeedFunctionPrototypes
  3703.     Display*        /* display */,
  3704.     Colormap        /* colormap */,
  3705.     XColor*        /* color */
  3706. #endif
  3707. );
  3708.  
  3709. extern XStoreColors(
  3710. #if NeedFunctionPrototypes
  3711.     Display*        /* display */,
  3712.     Colormap        /* colormap */,
  3713.     XColor*        /* color */,
  3714.     int            /* ncolors */
  3715. #endif
  3716. );
  3717.  
  3718. extern XStoreName(
  3719. #if NeedFunctionPrototypes
  3720.     Display*        /* display */,
  3721.     Window        /* w */,
  3722.     const char*        /* window_name */
  3723. #endif
  3724. );
  3725.  
  3726. extern XStoreNamedColor(
  3727. #if NeedFunctionPrototypes
  3728.     Display*        /* display */,
  3729.     Colormap        /* colormap */,
  3730.     const char*        /* color */,
  3731.     unsigned long    /* pixel */,
  3732.     int            /* flags */
  3733. #endif
  3734. );
  3735.  
  3736. extern XSync(
  3737. #if NeedFunctionPrototypes
  3738.     Display*        /* display */,
  3739.     Bool        /* discard */
  3740. #endif
  3741. );
  3742.  
  3743. extern void XTextExtents(
  3744. #if NeedFunctionPrototypes
  3745.     XFontStruct*    /* font_struct */,
  3746.     const char*        /* string */,
  3747.     int            /* nchars */,
  3748.     int*        /* direction_return */,
  3749.     int*        /* font_ascent_return */,
  3750.     int*        /* font_descent_return */,
  3751.     XCharStruct*    /* overall_return */
  3752. #endif
  3753. );
  3754.  
  3755. extern void XTextExtents16(
  3756. #if NeedFunctionPrototypes
  3757.     XFontStruct*    /* font_struct */,
  3758.     const XChar2b*    /* string */,
  3759.     int            /* nchars */,
  3760.     int*        /* direction_return */,
  3761.     int*        /* font_ascent_return */,
  3762.     int*        /* font_descent_return */,
  3763.     XCharStruct*    /* overall_return */
  3764. #endif
  3765. );
  3766.  
  3767. extern int XTextWidth(
  3768. #if NeedFunctionPrototypes
  3769.     XFontStruct*    /* font_struct */,
  3770.     const char*        /* string */,
  3771.     int            /* count */
  3772. #endif
  3773. );
  3774.  
  3775. extern int XTextWidth16(
  3776. #if NeedFunctionPrototypes
  3777.     XFontStruct*    /* font_struct */,
  3778.     const XChar2b*    /* string */,
  3779.     int            /* count */
  3780. #endif
  3781. );
  3782.  
  3783. extern Bool XTranslateCoordinates(
  3784. #if NeedFunctionPrototypes
  3785.     Display*        /* display */,
  3786.     Window        /* src_w */,
  3787.     Window        /* dest_w */,
  3788.     int            /* src_x */,
  3789.     int            /* src_y */,
  3790.     int*        /* dest_x_return */,
  3791.     int*        /* dest_y_return */,
  3792.     Window*        /* child_return */
  3793. #endif
  3794. );
  3795.  
  3796. extern XUndefineCursor(
  3797. #if NeedFunctionPrototypes
  3798.     Display*        /* display */,
  3799.     Window        /* w */
  3800. #endif
  3801. );
  3802.  
  3803. extern XUngrabButton(
  3804. #if NeedFunctionPrototypes
  3805.     Display*        /* display */,
  3806.     unsigned int    /* button */,
  3807.     unsigned int    /* modifiers */,
  3808.     Window        /* grab_window */
  3809. #endif
  3810. );
  3811.  
  3812. extern XUngrabKey(
  3813. #if NeedFunctionPrototypes
  3814.     Display*        /* display */,
  3815.     int            /* keycode */,
  3816.     unsigned int    /* modifiers */,
  3817.     Window        /* grab_window */
  3818. #endif
  3819. );
  3820.  
  3821. extern XUngrabKeyboard(
  3822. #if NeedFunctionPrototypes
  3823.     Display*        /* display */,
  3824.     Time        /* time */
  3825. #endif
  3826. );
  3827.  
  3828. extern XUngrabPointer(
  3829. #if NeedFunctionPrototypes
  3830.     Display*        /* display */,
  3831.     Time        /* time */
  3832. #endif
  3833. );
  3834.  
  3835. extern XUngrabServer(
  3836. #if NeedFunctionPrototypes
  3837.     Display*        /* display */
  3838. #endif
  3839. );
  3840.  
  3841. extern XUninstallColormap(
  3842. #if NeedFunctionPrototypes
  3843.     Display*        /* display */,
  3844.     Colormap        /* colormap */
  3845. #endif
  3846. );
  3847.  
  3848. extern XUnloadFont(
  3849. #if NeedFunctionPrototypes
  3850.     Display*        /* display */,
  3851.     Font        /* font */
  3852. #endif
  3853. );
  3854.  
  3855. extern XUnmapSubwindows(
  3856. #if NeedFunctionPrototypes
  3857.     Display*        /* display */,
  3858.     Window        /* w */
  3859. #endif
  3860. );
  3861.  
  3862. extern XUnmapWindow(
  3863. #if NeedFunctionPrototypes
  3864.     Display*        /* display */,
  3865.     Window        /* w */
  3866. #endif
  3867. );
  3868.  
  3869. extern int XVendorRelease(
  3870. #if NeedFunctionPrototypes
  3871.     Display*        /* display */
  3872. #endif
  3873. );
  3874.  
  3875. extern XWarpPointer(
  3876. #if NeedFunctionPrototypes
  3877.     Display*        /* display */,
  3878.     Window        /* src_w */,
  3879.     Window        /* dest_w */,
  3880.     int            /* src_x */,
  3881.     int            /* src_y */,
  3882.     unsigned int    /* src_width */,
  3883.     unsigned int    /* src_height */,
  3884.     int            /* dest_x */,
  3885.     int            /* dest_y */         
  3886. #endif
  3887. );
  3888.  
  3889. extern int XWidthMMOfScreen(
  3890. #if NeedFunctionPrototypes
  3891.     Screen*        /* screen */
  3892. #endif
  3893. );
  3894.  
  3895. extern int XWidthOfScreen(
  3896. #if NeedFunctionPrototypes
  3897.     Screen*        /* screen */
  3898. #endif
  3899. );
  3900.  
  3901. extern void XWindowEvent(
  3902. #if NeedFunctionPrototypes
  3903.     Display*        /* display */,
  3904.     Window        /* w */,
  3905.     long        /* event_mask */,
  3906.     XEvent*        /* event_return */
  3907. #endif
  3908. );
  3909.  
  3910. extern int XWriteBitmapFile(
  3911. #if NeedFunctionPrototypes
  3912.     Display*        /* display */,
  3913.     const char*        /* filename */,
  3914.     Pixmap        /* bitmap */,
  3915.     unsigned int    /* width */,
  3916.     unsigned int    /* height */,
  3917.     int            /* x_hot */,
  3918.     int            /* y_hot */             
  3919. #endif
  3920. );
  3921.  
  3922. #ifdef __cplusplus
  3923. }                        /* for C++ V2.0 */
  3924. #endif
  3925.  
  3926. #endif /* _XLIB_H_ */
  3927.